Free · runs in your browser · no upload · no quota
XML to JSON Converter
Convert XML — an RSS feed, a SOAP response, a sitemap, an export from an old system — into JSON. Attributes become @ keys, repeated elements become arrays, and the result reads back into XML with the JSON to XML tool.
How to Convert XML to JSON
- Add your XML
Paste it into the left box or open an .xml file — RSS feeds, sitemaps and SOAP responses work too. - Set the options
Turn on Always use arrays if your code needs the same shape every time, and Detect numbers and booleans for typed values. - Copy or download the JSON
Copy the result, or click Download to save a .json file.
Example
<library>
<book id="42">
<title>Dune</title>
</book>
<book id="7">
<title>Solaris</title>
</book>
</library>{
"library": {
"book": [
{"@id": "42", "title": "Dune"},
{"@id": "7", "title": "Solaris"}
]
}
}Frequently Asked Questions
-
How are attributes represented?As keys starting with
@. When an element has both attributes and text, the text is under#text. -
Why is one element an object and another an array?An element that appears more than once under the same parent becomes an array. Turn on Always use arrays if your code needs the same shape every time.
-
Does it handle namespaces and CDATA?Yes. Prefixed names such as
dc:titleare kept as they are, and CDATA sections are read as text. Comments and processing instructions are dropped. -
Is the XML uploaded?No. It is parsed by your browser's own XML parser and never leaves your device.
More browser tools
Working with files rather than text? Our file converters handle CSV to XML and 400+ other formats.