About this tool
XML still runs a quiet empire underneath the web: sitemaps that search engines read, RSS feeds, SVG images, office document formats, enterprise configs. It is also merciless about structure — one unclosed tag invalidates the whole file, and the file will not tell you where unless you ask a real parser. This tool asks one: the browser's built-in XML parser validates first, and only then does our formatter indent by nesting depth.
The formatting rule is conservative on purpose: element structure gets new lines and indentation, while text content is left exactly as written, because in XML whitespace inside an element can be meaningful. Attributes stay on their tag's line. The result is a document you can finally read top to bottom — and diff, review and hand-edit with confidence.
How to use it
- Paste your XML.
- Press Format & validate.
- If an error is reported, fix the named problem and run it again; otherwise copy the indented result.
Good to know
- The classic faults: an unclosed tag, a raw & that should be &, and mismatched case — <Item> does not close </item>.
- Pretty-printing a sitemap before submitting it makes manual URL checks far easier on the eyes.
- XML declarations (<?xml …?>) and comments are preserved at the top and in place.
Frequently asked questions
Is formatting the same as validating?
No — and this tool does both, in the right order: the parser validates first; if the document is broken, you get the error instead of misleading pretty output.
Will it change my data?
Only layout between elements. Text content and attributes are preserved as written.
Does it work for SVG files?
Yes — SVG is XML, so icons and illustrations format and validate the same way.
More Developer tools
JSON Formatter & Validator
Pretty-print messy JSON, minify it back, and get a precise error location when it will not parse.
JSON to CSV
Turn a JSON array of objects into a clean spreadsheet-ready CSV, columns and escaping handled.
CSV to JSON
Convert spreadsheet CSV into a JSON array — quoted fields, embedded commas and all.
JS / CSS / HTML Beautifier
Untangle minified or messy code into readable, consistently indented JavaScript, CSS or HTML.
JS / CSS Minifier
Strip comments and needless whitespace from JavaScript and CSS — smaller files, same behaviour.
Regex Tester
Test a regular expression against your text live — every match highlighted, groups shown.
Making videos too? Try our YouTube SEO Checker, or browse the full Toolkit and the free YouTube tools.