Pretty-printing dense XML
Formatting <root><item>1</item><item>2</item></root> with the default 2-space indent produces a multi-line, nested layout with root and each item tag properly indented.
Format, beautify, minify and validate XML online with custom indentation — free.
About
Pretty-prints XML with your choice of indent size, or minifies it down to a single compact line.
Developers working with SOAP APIs, RSS feeds or config files use it to make dense XML readable before debugging it, while anyone handed a minified XML export uses it to check the document is well-formed before importing it elsewhere. It's one of many free data tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.
Examples
3 worked examples
Formatting <root><item>1</item><item>2</item></root> with the default 2-space indent produces a multi-line, nested layout with root and each item tag properly indented.
Clicking Minify on a nicely indented multi-line document collapses it back to a single compact line with no whitespace between tags.
Pasting <root><item>1</item></root2> triggers a parser error message instead of formatted output, since the closing tag doesn't match the opening one.
FAQ
Quick answers to common questions about the XML Formatter and Validator.
It pretty-prints or minifies XML, and first checks that the XML is well-formed before doing either.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. Parsing, formatting and minifying all happen entirely on your own device using the browser's built-in XML parser — nothing you paste is sent to a server.
The tool reports the parser's error message instead of producing formatted or minified output, so you know exactly what needs fixing.
Yes. Set the indent size field to anywhere from 1 to 8 spaces before clicking Format.
No. It only checks that the XML is well-formed (correctly nested tags, matching quotes, and so on) — it doesn't validate the document's structure against a schema.
Minify strips whitespace between tags and collapses the document to one line, while Format adds line breaks and indentation for readability — both first confirm the XML is well-formed.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
Did XML Formatter and Validator work for you?