Free XML to JSON Converter
Convert XML into clean, indented JSON, instantly and entirely in your browser.
How to convert XML to JSON
-
1
Paste your XML
Paste any well-formed XML document into the input box.
-
2
Click "Convert →"
The XML is parsed and rebuilt as indented JSON, with repeated elements grouped into arrays.
-
3
Copy or download
Click "Copy JSON" to grab the text, or "Download .json" to save it as a file.
Example use cases
Consuming a legacy XML API in JS
Turn an XML response from an older SOAP or RSS-style endpoint into JSON your frontend or Node code can work with directly.
Migrating configuration
Move settings stored as XML into a JSON-based config format.
Inspecting an XML payload
JSON's key/value shape is often easier to scan than deeply nested XML tags when you just need to check a value.
Frequently asked questions
What does this converter do?
It parses your XML with the browser's built-in XML parser and rebuilds the same structure as indented JSON — elements become object keys, repeated sibling elements become an array, and element text becomes a string value.
How are XML attributes handled?
By default each attribute is added as a key prefixed with @ (e.g. <user id="1"> becomes {"@id": "1"}) so it doesn't collide with a child element of the same name. Untick the option to drop the @ prefix.
What happens to an element that mixes text and child elements?
Its own text is kept under a "#text" key alongside the child element keys, so nothing is silently dropped.
What if the XML is malformed?
The parser reports a "not well-formed" error with the problem it found, instead of guessing at a fix.
Is my data uploaded anywhere?
No. Conversion happens locally in your browser — nothing you paste is sent to a server.