XML Formatter
Format, minify, validate, and convert XML to or from JSON locally.
Runs locally
Loading tool…
Loading tool…
How to use
Choose Format to pretty-print or minify XML. Pick an indent width and optionally collapse paired empty elements such as <item></item> into <item/>. Validation errors include their line and column.
Choose Convert for XML ⇄ JSON. The attribute prefix controls how attributes are represented in JSON; the default @_ maps id="7" to "@_id": 7.
FAQ
Does formatting change XML values?
Pretty formatting changes whitespace between tokens. Minifying also trims text-node edges, so avoid it when surrounding whitespace is semantically significant.
How are repeated XML elements represented in JSON?
Repeated sibling elements become arrays. Attributes use the selected prefix, while element text is parsed as strings, numbers, or booleans when possible.