XML Formatter
Pretty-print XML with proper indentation. Free, no signup.
How It Works
Paste your XML and click Format. The tool validates the XML and re-indents it with consistent spacing, turning minified or single-line XML into a readable, properly nested structure. Invalid XML is flagged with an error message so you can fix it. Nothing is uploaded to a server.
Why Format XML?
Formatted XML is far easier to read, review, and debug — you can see the nesting, spot missing elements, and compare structures at a glance. It is helpful when inspecting API responses, configuration files, RSS or sitemap feeds, and SVG or SOAP payloads.
Frequently Asked Questions
How do I format or pretty-print XML?
Paste your XML into the box and click Format. The tool validates it and re-indents it with consistent spacing and line breaks so the structure is easy to read. Copy the result with the Copy button.
What does formatting XML do?
It adds proper indentation and newlines so nested elements line up visually. It does not change the data or the meaning of the XML — only its whitespace and layout, which makes minified or single-line XML readable.
Why do I get an error?
The XML is not well-formed — usually an unclosed tag, a mismatched tag name, a missing quote on an attribute, or an invalid character. Fix the reported issue and format again.
Is my XML uploaded to a server?
No. Parsing and formatting happen entirely in your browser, so your XML never leaves your device. It is safe for private configs and data feeds.
Can it minify XML instead of expanding it?
This tool pretty-prints (expands) XML for readability. To make XML readable is the goal here; for compact output you would need a minifier, such as the JSON Minifier for JSON data.