XML to JSON Converter
Turn XML into easy-to-use JSON for JavaScript, REST APIs, NoSQL databases and config files, with attributes, repeated elements and text mapped predictably.
Free · No sign-up · Files stay on your device
How to use XML to JSON
- 1Paste your XML.
- 2The JSON appears instantly.
- 3Copy or download it.
Features
- Attributes ↔ "@" keys
- Repeated elements ↔ arrays
- Pretty-printed output
- Clear error messages
- Runs locally in your browser
How the mapping works
Elements become object keys and their text becomes the value. Attributes are written as keys starting with "@" (for example "@id"), mixed text as "#text", and repeated elements with the same name become arrays. This common convention converts back and forth without losing information.
Frequently asked questions
What root element is used for JSON to XML?
If your JSON has one top-level key, that key becomes the root element; otherwise everything is wrapped in <root>.
Are numbers kept as numbers?
XML has no number type. XML to JSON keeps values as text unless you tick "Detect numbers and booleans".
Is my data uploaded?
No. Conversion happens in your browser.
Related tools
JSON to XMLConvert JSON to XML online for free. Arrays become repeated elements, "@" keys become attributes. Pretty-printed, valid XML output. Runs in your browser.XML FormatterFormat, beautify, validate and minify XML online for free. Get clear error messages for invalid XML. Works with sitemaps, RSS feeds, SVG and config files.JSON FormatterFormat, beautify, validate and minify JSON online for free. Find syntax errors with exact line numbers. Runs in your browser, your data is never uploaded.