XML → JSON

XML to JSON Converter

Paste XML and get clean, pretty-printed equivalent JSON — attributes, text nodes and repeated tags are all handled correctly.


          

How it works

1

Paste your XML

Any well-formed XML document or fragment works.

2

Parsed with DOMParser

Your browser's native XML parser builds the DOM tree, which is then converted to JSON.

3

Copy or download

Grab the pretty-printed JSON or save it as a .json file.

FAQ

How are XML attributes represented in the JSON?

Each attribute becomes a key prefixed with @, for example an id="5" attribute becomes "@id": "5" in the resulting object.

What happens to repeated tags?

When an element has multiple children with the same tag name, they are collected into a JSON array instead of overwriting each other.

Is my XML uploaded anywhere?

No. Parsing and conversion happen entirely in your browser using the native DOMParser API; nothing is sent to a server.

Try other tools