XML to JSON
Convert XML into clean JSON. Repeated elements become arrays, attributes are kept with an @ prefix, and numbers can be typed automatically.
Or paste the content instead
How the conversion works
- Elements become object keys; elements that repeat become arrays.
- Attributes are kept with an
@prefix, e.g."@id": 1. - Text next to attributes is stored under
"#text". - Types: with conversion on,
42becomes a number andtruea boolean. Codes with leading zeros, like007, stay as text.
How to use the XML to JSON
- Choose an XML file, or paste XML.
- Choose whether to keep attributes and convert types.
- Click Convert, then copy the JSON or download it.
Frequently asked questions
Is my file uploaded anywhere?
No. The file is read and converted by your own browser, so it never leaves your device. That makes it safe for customer lists, finances and other private data.
Why is a single element not an array?
An element that appears once becomes a plain value; it becomes an array only when it repeats. If your code always expects arrays, check for both cases.
Are namespaces supported?
Yes. Prefixed tags like media:content are kept as key names exactly as written.