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…
- Base64 Encode and Decode Paste text to get Base64, or paste Base64 to get the text back. Cyrillic, Chinese and emoji all…
- Word Counter Type or paste your text and the counters update instantly — words, characters, sentences, parag…
- Case Converter Paste text, pick a case, get the result. Nine ways of writing the same words: the four everyday…
- CSV to JSON Paste a table, get JSON. The parser follows RFC 4180, so a cell like «Doe, John» stays one fiel…
- JSON Beautifier Paste a wall of minified JSON and read it like a document. Indentation appears as you type, and…