About this tool
Convert XML into indented JSON. Attributes use @ prefixes, repeated tags become arrays and mixed text uses #text. Text values remain strings. Comments and original mixed-content ordering are not preserved; DTDs are rejected.
How to use XML to JSON
- Paste XML or choose an XML file.
- Select Convert to JSON to validate and convert the document.
- Download the indented JSON file.
Frequently asked questions
How are XML attributes represented?
An attribute named id becomes @id. Text alongside child elements is stored under #text.
What happens to repeated elements?
Sibling elements with the same tag name become an array. A single occurrence is stored as one value.
Does this preserve XML exactly?
No. Comments, processing instructions and mixed-content order are omitted. DTDs and entity declarations are rejected.