XML to JSON
Convert XML documents into clean, readable JSON right in your browser.
Convert XML to JSON
Result: —
How to use the XML to JSON
- Paste or type an XML document into the input box.
- Click Convert to JSON to parse elements, attributes and entities.
- Copy the escaped JSON output with the Copy button.
Features
- Attributes become at-prefixed keys in the JSON output
- Repeated sibling elements are collected into arrays
- Named and numeric entities are decoded
- Escaped JSON that is safe to embed in a page
Advertisement
Frequently Asked Questions
Common questions about the free online xml to json.
Paste your XML into the input box and click Convert to JSON. The document is parsed locally
and the formatted JSON appears for you to copy.
Every attribute becomes a key prefixed with the at sign, so an id attribute on a book element
appears as at id inside that book object.
When the same element name appears more than once under one parent, the values are collected
into a JSON array in document order.
Yes. Named entities such as amp, lt, gt, quot and apos plus numeric character references are
decoded into their real characters.
Yes. Clear the checkbox that converts numbers and booleans and every text value stays a plain
JSON string instead.
No. All parsing happens inside your browser, so your document never leaves your device and
nothing is stored.
Unclosed tags, mismatched closing tags, an empty input and more than one root element all
produce a clear error message instead of output.
Yes. CDATA sections are unwrapped and their text content is kept, so angle brackets inside
them survive the conversion.
Last updated: October 10, 2026