Format XML online: pretty-print with 2-space, 4-space or tab indentation, or minify to one line. Runs in your browser — nothing is uploaded. No upload — runs 100% in your browser
XML does not care about whitespace between tags — a machine reads a minified one-liner exactly the same as a deeply indented tree. Humans do care, though: reviews, diffs and merge conflicts all depend on one element per line with consistent indentation. This tool rewrites only the whitespace between tags: every element goes on its own line, nested content is indented by your chosen unit, and an element whose content is just short text stays on a single line instead of being split across three.
Three things are deliberately left alone. Attributes are kept exactly as you wrote them, on the same line as their tag, quotes untouched. Comments, CDATA blocks and the <?xml ?> declaration are passed through verbatim. And text inside elements only has its runs of whitespace collapsed — words themselves are never re-wrapped or re-ordered.
Pretty-print for anything a human will read: configuration files, API responses you are debugging, data files going into review. Minify for the wire: a smaller payload for the same data (parsers ignore inter-tag whitespace anyway, so minifying is lossless for XML semantics). The stats line shows the element count and maximum depth, which is often the fastest way to sanity-check a feed's structure.
The tool also counts opens and closes while it walks your document. If they do not balance, you get a warning with the stray-close and unclosed counts — that catches the most common hand-editing mistake (a deleted closing tag) before you ship the file. This is a well-formedness check, not validation: it does not verify your document against a DTD or XSD schema.
No. Everything on this page runs inside your browser using JavaScript and WebAssembly. Your file never leaves your device — you can even disconnect from the internet after the page loads and the tool still works.
No. Only whitespace between tags is rewritten, and runs of spaces inside text are collapsed to single spaces. Element names, attributes, order and values all pass through untouched.
No — it checks well-formedness (balanced tags) only. XSD/DTA schema validation is a different, heavier job; the balance warning catches the most common structural mistakes.
Elements whose content is short plain text are kept inline — that is the readable convention most formatters use. Longer or nested content is split across lines.
No hard limit; the whole file is parsed in your browser's memory. Files of several megabytes format in a moment on a modern laptop.