XML to JSON Converter
Turn XML documents into clean, nested JSON. Free, instant, and no signup required.
About XML to JSON conversion
XML is the long-standing format for SOAP web services, Office document internals (docx/xlsx), and schema-validated enterprise data exchange — its attribute and namespace support has no direct JSON equivalent. JSON is the format most HTTP APIs speak by default — compact, ubiquitous in JavaScript environments, and readable by virtually every language's standard library, though it has no comment syntax and no native date type.
Object keys become element names, repeated keys become sibling elements, and any key prefixed with @ becomes an XML attribute ("@id": "42" → <item id="42">). A #text key carries mixed text content alongside attributes or child elements.
How to convert XML to JSON
- Paste your XML into the left editor, or click sample above it to try example data.
- Click Convert. The JSON result appears on the right instantly.
- Click copy to copy the result, or download to save it as a file.
Example
Input (XML):
<person>
<name>Ada Lovelace</name>
<role>Mathematician</role>
<active>true</active>
<skills>math</skills>
<skills>programming</skills>
</person>
Output (JSON):
{
"person": {
"name": "Ada Lovelace",
"role": "Mathematician",
"active": "true",
"skills": [
"math",
"programming"
]
}
}