XML to JSON Converter
Convert XML to JSON and back, with attributes and nested elements — 100% in your browser.
Attributes map to “@name”, mixed text to “#text”, and repeated tags to arrays.
About XML to JSON Converter
Paste XML and get JSON, or switch direction to turn JSON back into XML. Element attributes become keys prefixed with “@”, mixed text content becomes “#text”, and repeated child elements collapse into arrays — a predictable, round-trippable convention.
XML parsing uses the browser's built-in parser, which reports malformed XML, and the JSON-to-XML direction is generated locally. Nothing you paste is uploaded.
XML to JSON
<note id="1"><to>Tove</to></note>
{ "note": { "@id": "1", "to": "Tove" } }Attributes use “@”, repeated tags become arrays. Switch direction for JSON → XML.
Frequently asked questions
How are attributes represented?
Each attribute becomes a key prefixed with “@” (e.g. @id), so it's distinct from child elements and survives a round trip.
What about repeated elements?
Repeated child tags with the same name are grouped into a JSON array automatically.
Does it validate the XML?
Yes. The browser's XML parser reports malformed XML with an error message.
Is my data uploaded anywhere?
No. Both conversions happen entirely in your browser.