XML formatter & converter. Parsed on your device.
Beautify, minify and validate XML with the exact error line and column, then convert XML to JSON or JSON to XML. Everything runs in your browser, nothing is uploaded.
A free online tool by Digital HeroesFiles never leave your browser, nothing is uploaded.
XML → JSON maps attributes to "@name" keys, element text to
"#text", and repeated siblings to arrays. JSON → XML reads JSON from the
input pane and wraps it in the root element name above (a single-key object becomes the root itself).
Format, convert and check, without a server round-trip
This XML formatter uses your browser's own XML parser, so it reports the exact line and column of a syntax error the way a compiler would, and it never sends your document anywhere. Beautify pretty-prints with 2-space, 4-space or tab indentation; minify collapses everything to one compact line; validate confirms well-formedness and counts the elements. Conversion is lossless-in-spirit: XML → JSON keeps attributes (as @-prefixed keys), text nodes, CDATA and repeated siblings as arrays, while JSON → XML rebuilds a document under a root element you name. No account, nothing uploaded, free forever.
Everything an XML tool should do.
- Beautify XML with 2-space, 4-space or tab indentation, and control whether the
<?xml?>declaration is kept. - Minify XML to a single compact line for production payloads.
- Validate XML and jump straight to the exact error line and column, shown with a caret under the offending character.
- Convert XML → JSON with attributes mapped to
@namekeys, text to#text, and repeated siblings collapsed into arrays. - Convert JSON → XML by wrapping your JSON under a named root, with optional number/boolean coercion, attribute sorting and self-closing empty tags.
- Drop or paste any file up to 15 MB, plus live validation as you type and one-click copy, download or swap-into-input. Nothing is uploaded.
Five steps, no manual.
- Paste or drop your XML or JSON into the input pane, or click Sample to load an example.
- Pick an action: Beautify, Minify, Validate, XML → JSON or JSON → XML.
- Adjust indent style, declaration, self-closing, comments, sorting or the root element name, the result re-formats instantly.
- If the input is invalid, read the exact error line and column and fix it in place.
- Copy or download the result, or hit Swap to move it back into the input for a follow-up pass.
Frequently asked questions.
Is the XML Formatter free?
Is it private? Are my files uploaded anywhere?
Does it work offline?
How does XML → JSON handle attributes and repeated tags?
@name keys, an element's text becomes a #text key, and repeated sibling elements are collapsed into a JSON array so nothing is lost. With Coerce numbers/booleans on, values like "42" and "true" become real numbers and booleans.Why does it show a line and column for errors?
^) under the exact character, so you can fix malformed XML the same way you would read a compiler error, without guessing.How big a file can I paste or drop?
Published · Last updated .