XML to JSON Converter
Turn XML from feeds, SOAP responses, sitemaps or old config files into JSON that's easy to use in JavaScript and APIs. Attributes, repeated elements and text are all mapped in a predictable way.
How to convert XML to JSON
- 1Paste your XML or open an .xml file.
- 2Choose how attributes are marked and whether numbers become JSON numbers.
- 3Copy the JSON or download it.
How elements map
Each element becomes a key. Attributes become keys with a prefix, like @id. An element that appears several times becomes an array, and text next to attributes or child elements goes under #text.
Numbers and true/false
With the option on, values like 44.95 and true become JSON numbers and booleans. Values with leading zeros, like 007 or 02134, stay text so nothing is lost.
What's left out
The XML declaration and comments are dropped. CDATA sections become plain text, and entities like & are decoded.
Frequently asked questions
- Is my data uploaded?
- No. Everything runs in your browser, so the JSON never leaves your device.
- Why is one element an object and another an array?
- An element that appears once becomes a single value; one that repeats becomes an array. Check a few records if your data varies.
- Are namespaces supported?
- Prefixed names like dc:title are kept as they are, as keys.