XML Formatter & Validator
Paste XML to pretty-print it with clean indentation, minify it for production, or convert it to JSON. Syntax errors are caught and reported. Everything runs locally in your browser — sitemaps, RSS feeds, SOAP payloads and API responses never leave your device.
Examples
<user id="1"><name>Ada</name></user>
<user id="1"> <name>Ada</name> </user>
How it works
The XML is read by the browser’s own parser, so anything that is not well-formed is reported with the parser’s message instead of being formatted wrongly. Beautify indents two spaces per level, keeps an element that only holds text on one line, and writes empty elements in the self-closing form. Minify removes the whitespace between tags.
| In the XML | In the JSON |
|---|---|
| An attribute, id="1" | A key with an @ prefix: "@id": "1" |
| The same child element repeated | An array under that element’s name |
| Text next to attributes or child elements | A "#text" key |
| An element that holds only text | A plain string |
Every JSON value is a string, because XML carries no types. Comments and CDATA sections are kept when beautifying or minifying; in JSON output comments are dropped and CDATA is treated as text. The XML declaration is kept, but a DOCTYPE is not carried into the output.
How to use XML Formatter & Validator
Why use this tool
Frequently asked questions
No. Parsing, formatting and conversion all happen in your browser using its native XML parser. Nothing is sent to a server.
Attributes become keys prefixed with @ (e.g. "@id"), and text content is stored under "#text" when an element also has attributes or children.
Yes — namespaced elements are preserved as-is, and CDATA sections are kept as text content.
Found a bug or have an idea?
ToolOrbit is actively developed — feedback directly shapes what gets built next.
Send feedback