XML to JSON
Convert XML into JSON, attributes and text nodes included.
Your data never leaves your browser
This tool runs entirely on your computer. What you paste or drop is never uploaded, never stored and never seen by us — close the tab and it's gone. How we know
Sign up to run — no credit card required.
Press Run to see the output. Sign up takes ten seconds — no credit card required.
Worked example
<a><b>1</b></a>{
"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
JSON Formattertakes json
Pretty-print and indent JSON — in your browser, nothing uploaded.
JSON Validatortakes json
Check whether JSON is valid and see the first error.
JSON to CSVtakes json
Turn a JSON array of records into CSV, with proper escaping.
JSON Minifiertakes json
Strip whitespace from JSON down to the smallest valid form.