Skip to content

XML to JSON

Convert XML documents into JSON.

Options

Private by design. This tool runs entirely in your browser. Your input is processed on your own device and is not uploaded by DO101.

About the XML to JSON

Parses XML with the browser's own strict parser and produces clean JSON, keeping attributes as @-prefixed keys and collapsing text-only elements into plain strings. Malformed XML is reported with the parser's own explanation.

How to use it

  1. 1Paste your XML.
  2. 2Choose how to handle attributes.
  3. 3Copy the JSON result.

What you get

  • Strict parsing with clear error messages
  • Attributes preserved as @-prefixed keys
  • Repeated elements become arrays automatically
  • Compact mode for text-only elements
  • Runs in your browser

Frequently asked questions

How are attributes represented?

As keys prefixed with @, so <price currency="GBP"> becomes {"@currency": "GBP"}. Turn the option off to drop them.

What happens to repeated elements?

The first occurrence becomes a value; a second occurrence turns the key into an array. That is the standard convention for this conversion.

Is the XML executed?

No. It is parsed into an inert document that is never attached to the page.

People who use this tool usually reach for these next.