XML to JSON
Convert XML to JSON in your browser — attributes become @-keys, repeated elements become arrays, and malformed input gets a friendly line-level error.
This tool runs entirely in your browser. Your data never leaves your device — it is not uploaded to any server.
How to use
- 1Paste your XML into the left pane.
- 2The pretty-printed JSON appears on the right as you type.
- 3Copy the JSON when it looks right.
XML to JSON
Paste sitemap entries, RSS items, SOAP responses or config files and get pretty-printed JSON back instantly. The conversion uses fast-xml-parser with attributes preserved: every attribute is kept as an @-prefixed key, repeated sibling elements collapse into arrays, and text content sits under #text when an element has attributes as well.
Malformed input never produces half-converted guesses: the document is validated first, and errors point at the offending line, so a missing closing tag is a one-line fix.
Frequently asked questions
How are attributes represented in the JSON?
Each attribute becomes a key prefixed with @ — <book id="7"> comes back as { "@id": "7" }. Attribute values stay strings, while text content that looks like a number or boolean is converted to its JSON type.
What happens to repeated elements?
Sibling elements with the same name become a JSON array. Note that a single element stays a plain value, so check for array-ness if your consumer expects lists.
Is my XML uploaded anywhere?
No. Parsing happens locally in your browser with fast-xml-parser — nothing leaves your device.
Related tools
JSON to XML
Convert JSON to well-formed XML with attributes, repeated elements and correct escaping — round-trips with our XML to JSON tool. All local, all instant.
All tools →
XML Formatter
Beautify XML online with clean 2-space indentation — sitemaps, RSS feeds, SOAP envelopes and config files become readable again, right in your browser.
All tools →
XML Validator
Check XML for well-formedness in real time: mismatched tags, broken attributes and invalid entities are reported the moment you paste. Nothing is uploaded.
All tools →
JSON Formatter
Format and beautify messy JSON online — 2 spaces, 4 spaces or tabs, with instant validation and precise error locations. 100% in your browser.
All tools →
Embed this tool
Put this tool on your own site with one line — it runs entirely in the visitor's browser.
<iframe src="https://zoyku.com/en/tools/xml-to-json?embed=1" width="100%" height="640" style="border:0;border-radius:16px" title="Zoyku — xml-to-json" loading="lazy"></iframe>