YAML, XML & Data 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 / settings:
<person id="7"><name>Ada</name><active>true</active></person>
Output:
{
"person": {
"@attributes": {
"id": "7"
},
"name": "Ada",
"active": "true"
}
}When to use
- Inspect XML responses in JSON tooling.
- Prepare XML data for JavaScript code.
- Review XML attributes alongside element values.
Overview
Convert XML elements and attributes into a JSON structure.
Supported input
XML text
Output details
JSON
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers.
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.