Skip to content

XML to JSON

Convert XML to JSON and download the result. Your input stays in your browser.

For the reverse conversion, use JSON to XML.

Use it when
Inspect XML elements, attributes, and text in a JSON tree.
Keep in mind
The output represents elements by name, attributes, and ordered children. Remove DTDs, comments, and processing instructions before conversion.
XML input
<item id="7">Pen</item>
JSON output
{
  "name": "item",
  "attributes": {"id": "7"},
  "children": ["Pen"]
}
Input limit: 5 MiB

Your input stays in this browser. We don’t upload it. How we handle your data .

How to convert XML to JSON

Paste XML or open a local file. Select Convert to JSON, then download the result.

Frequently asked questions

Why does the JSON include line breaks inside children?

The converter preserves whitespace inside elements as text. Indentation between XML tags can therefore appear in the JSON as a string with escaped line breaks.