XML to JSON Converter
runs in your browserno sign-upfree
Convert XML into clean JSON, keeping attributes, repeated elements and values.
Converted to JSON
About this tool
This converter turns XML into readable JSON. Attributes are kept with an "@_" prefix, repeated elements become arrays, and numbers and true/false values can be converted to real JSON numbers and booleans. Invalid XML is reported with its line and column.
How to use
- Paste your XML into the XML box.
- Choose whether to keep attributes and convert number and boolean values.
- Copy the JSON or download it as a .json file.
FAQ
How are attributes and lists represented?
Keys that start with "@_" are XML attributes (for example "@_id": 7 becomes id="7"), "#text" holds the text of an element that also has attributes, and a JSON array becomes repeated elements with the same name. The same rules are used in both directions, so data converts back and forth cleanly.
What happens to the XML declaration and comments?
The <?xml ?> declaration, processing instructions and comments are not part of the data, so they are left out of the JSON.
Is my data uploaded?
No. The conversion runs in your browser, so your data never leaves your device.