XML to JSON Converter

Convert XML to JSON format instantly. Handles attributes, nested elements, and repeated tags automatically.

How This Tool Converts XML to JSON

When to Use XML to JSON

Frequently Asked Questions

How are XML attributes handled in the JSON output?

XML attributes are placed in an @attributes object inside the element's JSON representation. For example, <user id="1"> becomes { "user": { "@attributes": { "id": "1" } } }.

How are repeated XML elements converted?

Repeated sibling elements with the same tag name are automatically converted to a JSON array. Three <role> elements become "role": ["admin", "editor", "viewer"].

Is my XML data sent to a server?

No. All conversion happens entirely in your browser. Your data never leaves your device.

What happens when an XML element has both text and child elements?

When an element contains both text content and child elements, the text is placed under a #text key alongside the other child keys. For example, <item>Note: <name>Alice</name></item> becomes { "item": { "#text": "Note: ", "name": "Alice" } }.

Can this tool convert SOAP XML?

Yes. SOAP envelopes convert to nested JSON objects. Namespace prefixes such as soapenv: or ns: are preserved as part of the key names in the output — <soapenv:Envelope> becomes a key named soapenv:Envelope in the JSON.