XML TO JSON CONVERTER
Convert XML ↔ JSON bidirectionally. Attributes, arrays, and text nodes are handled automatically. Nothing is uploaded.
In short
Convert XML to JSON or JSON back to XML instantly in your browser. Attributes become @-prefixed keys, nested elements become objects or arrays. Nothing is uploaded.
XML → JSON
Output will appear here
How to convert XML to JSON
- 1
Paste your XML (or JSON) into the input panel.
- 2
The tool defaults to XML → JSON mode; click the swap button to reverse the direction.
- 3
Click Convert and see the result appear instantly.
- 4
Copy the output or clear the panels to start over.
Questions
- How are XML attributes mapped to JSON?
- Attributes become keys prefixed with @, for example id="1" becomes "@id": "1". Text content of a mixed element goes into a "#text" key.
- How are repeated XML child elements handled?
- If an element appears more than once under the same parent it becomes a JSON array. A single occurrence stays a plain object or string.
- Can I convert JSON back to XML?
- Yes — click the swap button to switch to JSON → XML mode. Keys starting with @ become attributes, and arrays produce repeated sibling elements.
- Is my data sent to a server?
- No. All conversion happens locally in your browser using the built-in DOMParser and XMLSerializer APIs.
Related tools
- YAML ⇄ JSON ConverterConvert YAML to JSON or JSON to YAML instantly in your browser, with clear error messages when parsing fails.
- CSV ⇄ JSON ConverterConvert CSV to JSON or JSON back to CSV, with correct quoted-field and comma handling — entirely in your browser.
- XML Formatter & MinifierPretty-print XML with correct indentation or strip whitespace to minify it. Catches syntax errors inline — nothing uploaded.
- Unix Timestamp ConverterConvert Unix/epoch timestamps to human-readable dates in UTC and your local timezone, or a date back to a timestamp — client-side, no upload.
- JSON Schema ValidatorValidate JSON data against a JSON Schema and see every failing property with its exact path and reason.
- ISO 8601 Date ConverterBuild or parse an ISO 8601 date/time, with week date, ordinal date, and Unix timestamp forms included.
- YAML ValidatorValidate YAML syntax instantly and preview the parsed structure as formatted JSON. Clear error messages on failure — nothing uploaded.
- JSON VisualizerExplore JSON as a tree, table, or mindmap.
Updated