Pre-launch — your 10 free credits are reserved for launch day. Join the waitlist
converters · free tool

XML to JSON

Convert XML into JSON, attributes and text nodes included.

Runs in your browser — your data never leaves it

Paste, type, or drop a file. Runs as you type.

Output appears here as you type.

Worked example

Input
<a><b>1</b></a>
Output
{
  "a": {
    "b": "1"
  }
}

This example is one of XML to JSON's test cases — if the tool stopped producing this output, the build would fail.

Questions

How do I tell attributes from elements in the output?
Attributes carry an @_ prefix; an element's own text sits under #text. Nothing is silently merged, so you never lose the distinction.
Are numbers converted?
No — values stay strings. SAP data is full of leading zeros and fixed decimals that JavaScript would quietly destroy by parsing (0012340 becoming 12340). Keeping strings is the safe default.

Related tools