XML to JSON Converter
Convert XML into clean JSON, with attributes, text and repeated elements handled for you.
Loading tool…
How to use the XML to JSON Converter
- 1
Paste your XML or open an .xml file.
- 2
Choose compact or consistent output and how attributes and text are named.
- 3
Copy the JSON or download it as a .json file.
Frequently asked questions
How are attributes shown?
Attributes become keys with a prefix, "@" by default, so <book id="1"> gives "@id": "1".
What is compact mode?
Compact mode turns text-only elements into plain values and only uses arrays for repeated elements. Turn it off to get the same shape for every document, which is easier to process in code.
What if my XML has an error?
Your browser's XML parser checks the document and the tool shows the problem with its line and column.