Jsonic's XML to JSON converter parses any valid XML document and produces clean, formatted JSON. XML elements become JSON object keys, text content becomes string values, and repeated sibling elements automatically become JSON arrays. Numbers and booleans in text nodes are cast to their native JSON types. All parsing happens in your browser using the built-in XML parser — your data is never uploaded.
How to convert XML to JSON
- Paste your XML into the left panel.
- Click Convert.
- Formatted JSON output appears in the right panel.
- Click Copy or Download to save the result.
FAQ
How are repeated XML elements handled?
When multiple sibling elements share the same tag name, they are automatically grouped into a JSON array. For example, three <item> elements become an array under the "item" key.
Are XML attributes converted?
This converter focuses on element content and text nodes. XML attributes are not included in the JSON output.
How are empty XML elements handled?
Empty elements (self-closing tags or elements with no content) are converted to null in JSON.
Is the JSON output formatted?
Yes. The output uses 2-space indentation for readability.
Is my XML data sent to a server?
No. Conversion runs entirely in your browser using the built-in DOMParser API. Your data never leaves your device.
Can I convert JSON back to XML?
Yes — use our JSON to XML converter for the reverse direction.
What XML versions are supported?
The converter supports well-formed XML 1.0 documents, including those with an XML declaration and standard namespaces.