Convert between XML and JSON, or just format XML. Fully in-browser.
Convert between XML and JSON right in your browser, or simply pretty-print messy XML. Paste any document or drop an .xml or .json file — the tool parses it with fast-xml-parser and outputs clean, indented results. Attributes can be preserved (prefixed with @_) so round-tripping stays lossless. Everything runs locally; your payloads never touch a server.
Pick a direction
Choose XML → JSON or JSON → XML. If you just want to pretty-print XML without converting, use the Format XML button.
Paste or drop a file
Drop a .xml or .json file onto the upload area, or paste content directly into the input panel. Dropping a file auto-selects the matching direction.
Tune options
Toggle Preserve attributes to keep XML attributes in the JSON (and back). Adjust the indent size for the output.
Copy or download
Click Copy to send the result to your clipboard, or Download to save it as .json or .xml depending on the direction.
No. Parsing and conversion happen entirely in your browser using fast-xml-parser. Nothing is uploaded or logged.
When on, XML attributes are kept and exposed in JSON with an @_ prefix (e.g. <user id="1"/> becomes { "user": { "@_id": 1 } }). When off, attributes are dropped. Leave it on for lossless round-trips.
Most JSON shapes convert cleanly, but XML requires a single root element and string-like keys. If your JSON has multiple top-level keys, wrap it in a root object first.
Parsing normalizes whitespace and attribute order. Content is semantically equivalent, but byte-for-byte identity isn't guaranteed. Use Format XML if you only want to re-indent the original.
No hard limit — it's bounded by your browser's memory. Documents up to several megabytes typically work without issue.