XML to JSON

Convert XML documents into clean, readable JSON right in your browser.

Convert XML to JSON

Result: —
Entities are decoded on the way in and the JSON output is escaped so it can be embedded in a page safely.

How to use the XML to JSON

  1. Paste or type an XML document into the input box.
  2. Click Convert to JSON to parse elements, attributes and entities.
  3. Copy the escaped JSON output with the Copy button.

Features

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