XML Formatter & Minifier
Re-indent messy XML with proper nesting — or minify it down for transport. Transformations happen in place.
How it works
The tokenizer walks tags, text, comments, CDATA and processing instructions, then re-emits them with indentation based on nesting depth. Text that contains only whitespace between tags is structural and gets re-indented; real text content stays attached to its element. Minify removes all structural whitespace while preserving text and CDATA exactly. Well-formedness is checked before every transform, and Undo restores the previous content.
FAQ
Does it validate my XML?
It checks well-formedness (balanced tags, proper quoting) while tokenizing and reports the problem if found. DTD/schema validation is not performed.
Is my XML uploaded?
No. Formatting runs in your browser with the native parser API.