JSON ↔ XML Converter
Convert JSON to XML or XML to JSON with a single click. Handles nested objects, arrays, attributes, and text nodes. Runs entirely in your browser.
Input
How it works
- JSON → XML: objects become elements, arrays repeat the element, scalars become text; attributes are not used (clean 1:1 mapping).
- XML → JSON: elements become objects, repeated element names become arrays, text-only elements become strings, and attributes appear under
@attrkeys. - Output is indented for readability and valid in both directions for the data shapes shown here.
About JSON ↔ XML Converter
JSON and XML both describe hierarchical data, but with very different conventions: JSON has objects, arrays, and a compact syntax, while XML has elements, attributes, text nodes, and namespaces. Converting between them is common when integrating JSON-first APIs with XML-based systems — SOAP web services, legacy enterprise middleware, RSS/Atom feeds, or configuration formats like Maven POM files.
No mapping is perfectly lossless in both directions: JSON has no notion of attributes, so this tool uses plain elements on the way out and puts XML attributes under @-prefixed keys on the way in; repeating XML elements collapse into arrays. Whitespace-only text nodes are dropped. For exotic documents (mixed content, namespaces, CDATA) review the output — but for typical API payloads the round trip is clean. Everything runs locally in your browser.