Skip to content
📋

XML to JSON

Conversion

Free online XML to JSON converter. Convert XML documents to JSON with attribute handling, array options, and pretty-print output. Runs in your browser.

0
0
XML Input
JSON Output
 - 

Quick answers for XML to JSON

How does the XML to JSON converter handle attributes?
Attributes are placed under an `@attributes` key on the parent object. Text content from a mixed node goes under `#text`. This is the convention used by xml2js and many other libraries - it round-trips cleanly back to XML.
Does it handle repeated child elements?
Yes. When the same tag appears multiple times under the same parent, the converter emits an array. A single occurrence stays as an object - the most common convention for XML-to-JSON mapping.
Can I convert JSON back to XML?
Yes. Switch the direction tab and the tool emits well-formed XML, restoring `@attributes` to real attributes and `#text` to inner text. The JSON must have exactly one root key, since XML requires a single root element.
What about XML namespaces and CDATA?
Prefixed element names (like `ns:tag`) are preserved as-is in the JSON keys. CDATA sections collapse to plain text content during parsing. For specialised XML-Schema work you'll want a dedicated tool.
Is the XML uploaded somewhere?
No. The XML to JSON tool uses the browser's built-in DOMParser; no parsing happens on a server. SOAP responses and config files stay private to your browser.