XML to JSON converter

Convert an XML document into a JSON object — elements keyed by name, repeated siblings as arrays, attributes under @.

Converted in this browser. Nothing is sent anywhere.

Elements become objects keyed by tag name; repeated sibling tags merge into arrays; attributes are prefixed with "@"; mixed text lands under "#text". Comments, processing instructions and the DOCTYPE are dropped. Up to 200,000 characters.

How to use

  1. Paste the XML.
  2. Convert it.
  3. Copy or download the JSON.

What it supports

Element children become object keys, same-name siblings become arrays, attributes carry an @ prefix, and mixed text lands under #text. Comments, processing instructions, and doctype are dropped. Input up to 300,000 characters.

Related tools

Related guides