XML Formatter
Beautify and validate XML in one click.
Minified XML is unreadable, and one bad tag breaks everything. Paste XML and this tool pretty-prints it with clean two-space indentation, flags syntax errors with the browser's own parser message, and lets you minify it back down when you need compact output. Validation and formatting happen entirely in your browser, so your data stays private. Use it for configs, feeds, sitemaps, and API payloads.
Loading tool…
If the tool stays on this message, make sure JavaScript is enabled, then reload the page.
About XML Formatter
XML shows up in configs, RSS feeds, sitemaps, SOAP payloads, and office file formats, and it usually arrives minified onto one long line. Reading it that way means scrolling sideways and guessing where elements nest. This formatter lays it out with two-space indentation so the structure is obvious at a glance.
Formatting is also validation. The tool parses your XML with the browser's own XML parser, so a missing closing tag or a stray character produces a real error message instead of silently mangled output. Fix the reported problem and format again.
When you are done editing, Minify compacts the XML back to a single line for storage or transmission. Comments and CDATA sections are preserved through both directions.
How to use XML Formatter
- Paste XML into the input box.
- Click Format to beautify it, or Minify to compact it.
- Fix any error the validator reports.
- Copy the result or download it as an .xml file.
Why use this tool?
- Validates XML and reports errors
- Clean two-space indentation
- Minify back to compact XML
- Free with no account or signup
Tips for best results
- Fix the first reported error first, since one bad tag can cascade.
- Minify before pasting XML into a config or a URL parameter.
- Comments and CDATA sections survive formatting.
- Use the JSON Formatter if your API actually returns JSON, not XML.