Data Formats utility
XML to JSON
Convert XML elements and attributes into a JSON structure.
● This tool runs entirely in your browser. Your input is never uploaded to our servers.
Output
Your result will appear here…
How to use XML to JSON
- Paste a well-formed XML document.
- Select Convert to map elements and attributes to JSON.
- Copy the formatted JSON output.
Example
Input:
<person id="7"><name>Ada</name><active>true</active></person>
Output:
{
"person": {
"@attributes": {
"id": "7"
},
"name": "Ada",
"active": "true"
}
}Use cases
- Inspect XML responses in JSON tooling.
- Prepare XML data for JavaScript code.
- Review XML attributes alongside element values.
About this tool
Convert XML elements and attributes into a JSON structure. Processing happens locally in your browser, so your input is not sent to a server or included in analytics.
Frequently asked questions
How are attributes represented?
Attributes are grouped under an @attributes object.
How are repeated elements represented?
Repeated sibling elements with the same name are collected into arrays.
Are XML values converted to numbers or booleans?
Element text is kept as strings to preserve the source value.