XML to JSON
Paste XML and it converts to JSON automatically — nothing leaves your browser.
How It Maps
- Attributes become
@namekeys - Repeated tags become arrays
- Mixed text uses a
#textkey - Instant conversion as you paste
- Copy or download the result
Features & Supported Capabilities
- Detects and reports invalid XML before converting
- Preserves nested structure exactly
- Handles files up to 10 MB
- Optional line wrapping for long output
- Runs entirely in your browser — nothing uploaded
About this XML to JSON converter
Converting XML to JSON is a common step when moving data from SOAP services, legacy systems and feeds into modern JavaScript and REST APIs. This free online XML to JSON converter maps elements to objects, turns repeated elements into arrays, keeps attributes and preserves text content, so the structure of your data carries over.
The conversion runs in your browser and nothing is uploaded. If you need the reverse, use JSON to XML. To tidy the XML first try the XML formatter, and to check the result use the JSON formatter or JSON viewer.
Frequently Asked Questions
Everything you might want to know about the online XML to JSON converter.
@, e.g.
<book id="1"> becomes "@id": "1", so attributes stay
distinguishable from child elements.
<book>...</book> repeated three times under
<library> becomes a "book": [...] array of three items.
"#text" key alongside them.
Copy button to copy it to your clipboard, or
Download to save it as a .json file.