Skip to content
Zoyku

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

  1. 1Paste your XML into the left pane.
  2. 2The pretty-printed JSON appears on the right as you type.
  3. 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.

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>
100% local processing