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
<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.