Code tool

XML to JSON Converter

Turn XML into copyable JSON in your browser while keeping attributes, repeated child elements, and mixed text content explicit.

In-browser processingNo account requiredPrivacy details ↗

Enter valid XML up to 200,000 characters. Parsing happens locally in your browser.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste valid XML up to 200,000 characters.
  2. Convert it and review the JSON mapping for elements, attributes, arrays, and text.
  3. Copy the JSON or download it as a .json file.

Predictable XML mapping

The document element becomes the top-level JSON property. Child elements become properties, repeated siblings become arrays, and attributes are grouped under @attributes. Text that appears alongside child elements is kept under #text so mixed content is not silently lost.

Local parsing with clear boundaries

Parsing, conversion, copying, and download preparation happen in your browser. Comments and processing instructions are ignored, CDATA becomes text, and empty elements become empty strings. The converter does not fetch external entities or remote resources.

GOOD TO KNOW

Common questions

How are repeated XML elements represented?

Repeated siblings with the same name become a JSON array in their original order.

Where do XML attributes go?

Attributes are collected under an @attributes object on the corresponding element.

Does conversion upload my XML?

No. XML parsing and JSON conversion happen locally in your browser.