Free Online XML to JSON Converter

Parse any XML document and convert it to a structured JSON object instantly. Handles attributes, nested elements, arrays, and namespaces.

Related Tools

Frequently Asked Questions

How are XML attributes handled in the JSON output?

XML attributes are mapped to a special key (typically $ or @) in the JSON object, following the xml2js convention. For example, <item id="1"> becomes { "$": { "id": "1" }, "_": "..." }.

Are XML namespaces preserved?

Yes. Namespace prefixes are preserved as part of the key names in the output JSON. Namespace declarations (xmlns) are also included in the attribute object.

What happens with repeated XML elements?

Repeated sibling elements with the same tag name are collected into a JSON array. A single element produces an object; multiple produce an array — this is standard xml2js behavior.