XML to JSON Converter
Paste XML (or open a file) and get the same data as JSON.
How XML becomes JSON
- The root element becomes the top-level key.
- Child elements become properties. If an element name repeats (several <book> tags), they become a JSON array.
- Attributes become properties prefixed with @ (id="1" → "@id": "1"), or you can drop them.
- An element with both text and children keeps its text as "#text".
- With "detect numbers", values such as 450 and true become JSON numbers and booleans instead of strings. Leave it off to keep codes like 0300 exactly as written.
Watch out for single items
XML doesn't say whether an element is a list. A catalog with only one <book> gives an object, and with two it gives an array. If your code expects arrays every time, tick "Always use arrays". Comments and processing instructions are left out; namespaces stay in the element names (for example "soap:Body").
The conversion uses your browser's XML parser, so invalid XML gives a clear error and nothing is uploaded. To go the other way or to edit JSON, see the JSON Formatter and CSV to JSON tools.
How it works
- Open — choose your file; it stays on your device.
- Work — make your changes right in the browser.
- Save — download the result straight to your device.
Related tools
View allPrefer to just describe the task? The AI Assistant can convert, compress and resize files from a short instruction.
Rate this tool
Log in to leave a review.