XML to JSON Converter

Paste XML or open an XML file and get tidy JSON back. Your data is processed in your browser and is never uploaded.

How the conversion works

There is no single standard for mapping XML to JSON, so this tool uses the common convention: each element becomes a key; attributes become keys with a prefix (@id); text that sits beside child elements is stored under a text key (#text); elements with only text become plain values; and elements that repeat under the same parent become an array. Tick Always use arrays if your code needs a consistent shape even when an element appears only once.

The parser is strict: it reports the line and column of the first problem, such as a missing closing tag. Comments, processing instructions and the DOCTYPE are ignored; CDATA sections are kept as text. The opposite direction is available in the JSON to XML converter, and to check a document use the XML formatter & validator.

Running into a technical issue or something that doesn't work right on this page? Please let us know straight away via our Contact page — that's how we find out what's broken and get it fixed.