What is this XML to JSON converter?
A free, browser-based tool that converts XML to JSON as you type. Paste your XML and the JSON appears instantly, ready to copy or download. All processing happens locally in your browser, so your data is never uploaded.
How to use it
- Paste your XML into the left panel, or upload a XML file.
- The JSON output appears instantly on the right as you type.
- Copy the result or download it as a file.
How the data is mapped
- XML attributes become "@name" keys (e.g. id="1001" → "@id": "1001").
- Repeated sibling elements with the same tag become a JSON array.
- Text-only elements become plain strings; an element with both attributes and text keeps its text under "#text".
Example
Input (XML)
<order id="1001">
<customer>Alice</customer>
<item>
<sku>A-1</sku>
<qty>3</qty>
</item>
<item>
<sku>B-2</sku>
<qty>5</qty>
</item>
</order>Output (JSON)
{
"order": {
"@id": "1001",
"customer": "Alice",
"item": [
{ "sku": "A-1", "qty": "3" },
{ "sku": "B-2", "qty": "5" }
]
}
}XML vs JSON at a glance
| Format | Type | Structure | Best for |
|---|---|---|---|
| XML | Plain text markup | Nested named elements plus attributes | System integrations, feeds, legacy APIs |
| JSON | Plain text | Objects, arrays, strings, and numbers | Modern APIs and programming |


