XML to JSON
Convert XML to a JSON element tree with names, attributes, and ordered content.
Runs on your device. Nothing you add is uploaded.
JSON
{
"name": "garden",
"attributes": {
"open": "true"
},
"children": [
"\n ",
{
"name": "name",
"children": [
"Riverside Garden"
]
},
"\n ",
{
"name": "bed",
"attributes": {
"id": "east"
},
"children": [
"Basil & dill"
]
},
"\n ",
{
"name": "bed",
"attributes": {
"id": "west"
},
"children": [
"Mint"
]
},
"\n"
]
}How to use XML to JSON
- Paste the XML document.
- Review the result and correct any reported syntax errors.
- Copy the converted JSON.
Questions
How is the document represented after conversion?
Attributes and mixed text are preserved in the element tree. Comments, the XML declaration, and processing instructions are omitted.
Where is my input processed?
On your device. The tool does not upload the input or its result.
How this works
Parses XML with Saxes and builds XML from JSON using escaped text and attribute values.
Everything happens in this browser tab. What you type or add stays on your device, and the page has no tracking. Your last settings are kept in this browser so the tool opens the way you left it. Privacy