XML Formatter
Paste XML to see it properly indented and checked in the same moment. Mismatched and unclosed tags are reported with a line number rather than a browser parse error, and nothing you paste leaves your machine.
Formatted
Formatted XML appears here.
Validates as you typeErrors give a lineNothing uploadedWorks offline
Common questions
- What does it check for?
- Every opening tag must be closed by a matching closing tag in the right order. Unclosed tags, stray closing tags, mismatched pairs, and unterminated comments or CDATA sections are all reported, with the line number where the problem starts.
- Are comments and CDATA preserved?
- Yes. Comments, CDATA sections, the XML declaration, DOCTYPE and processing instructions all survive formatting untouched.
- What about attributes containing angle brackets?
- Handled correctly. A value like cond="x > y" does not confuse the parser, which is a common failure in naive formatters.
- Why do short elements stay on one line?
- Because splitting <name>Harsh</name> across three lines makes it harder to read, not easier. Elements with a single text child are kept inline.
- Is my XML uploaded?
- No. Parsing, validation and formatting all happen in your browser, which matters when the file is a config or a service manifest. Your draft is kept on this device only.
- Will formatting change my data?
- No. Only whitespace between elements is altered. Attribute order, CDATA sections, comments, entity references and text content are all preserved exactly, so the reformatted document is byte-equivalent in meaning to the original. Malformed XML is reported with a position rather than silently repaired into something that parses but says something different.
Formatting is exact and lossless: indentation changes only whitespace between elements, never content, attribute order or CDATA. Malformed XML is reported with the position of the problem instead of being silently repaired.