XML Formatter
Machine-generated XML arrives as one enormous line. Paste it here and the structure appears: one element per line, indented by depth.
The code never leaves this page: formatting happens in your browser.
- Free
- Files never leave your device
- No sign-up
- No file limit
How to use
- Paste the XML into the first box.
- Choose the indent: two spaces, four, or a tab.
- Copy the readable version, or press «Minify» to compress it back.
Good to know
Where XML differs from HTML
XML has no void elements — everything either closes or ends with a slash — and it is case-sensitive, so <Item> and <item> are different elements. The formatter treats it accordingly: nothing is assumed to be self-closing, and tag names are never lowercased. That is why this page exists separately from the HTML formatter.
Comments, CDATA and the declaration
A CDATA section can contain anything, including angle brackets that look like tags. It is carried across as one block, as is a comment, so a SOAP envelope with escaped markup inside survives the trip. The XML declaration at the top stays on its own line where parsers expect it.
Frequently asked questions
Does it check that my XML is well-formed?
No. It indents what you give it. A missing closing tag shows up as indentation that never comes back, but no error list is produced.
Will it work with SVG, RSS or a sitemap?
Yes — all three are XML. A sitemap with thousands of URLs becomes readable, and an SVG exported from a design tool stops being a single line.
Is my file sent to a server?
No. Formatting happens in your browser, so an XML export with customer records stays on your machine.
Are attributes reordered or reformatted?
No. A tag is moved to its own line and indented, but what is inside the angle brackets is left exactly as you wrote it.
Related tools
- HTML Formatter Paste HTML and read it. Each tag goes on its own line with the indentation its nesting deserves…
- JSON Formatter and Validator Paste JSON and get it formatted, validated or minified. The data stays in your browser — nothin…
- YAML to JSON Paste a config file and get JSON. Anchors are expanded, block strings keep their line breaks, a…
- HTML Minifier Paste HTML and get it back without the whitespace nobody sees. The counter under the box shows…
- CSS Formatter Paste a stylesheet — even one that arrived as a single line — and read it again. Each declarati…
- CSS Minifier Paste a stylesheet and get it back compressed. The counter under the box shows the size before…
- SQL Formatter Paste a query that arrived from a log or an ORM as a single line, and read it as a query again…