Explosion Tools

XML to JSON Converter

Convert XML to JSON with attribute preservation, CDATA support, and pretty-printed output.. Gratis, sin registro, funciona en tu navegador.

Acerca de XML to JSON Converter

This XML to JSON converter transforms XML documents into well-formatted JSON using the browser's native DOMParser. Attributes are preserved as @-prefixed keys, repeated child elements become arrays, and CDATA sections are treated as text content. The output is pretty-printed with 2-space indentation for easy reading. Useful for API migration, data transformation, configuration conversion, and working with legacy XML systems that need to integrate with modern JSON-based tools.

Preguntas frecuentes

How are XML attributes handled?
XML attributes are converted to JSON keys prefixed with @. For example, <book category="fiction"> becomes { "@category": "fiction" }. This convention prevents conflicts between attribute names and child element names.
What happens with repeated elements?
When an XML element has multiple children with the same tag name, they are automatically grouped into a JSON array. For example, multiple <item> elements become an array under the "item" key.
Does it handle CDATA sections?
Yes. CDATA sections are treated as text content and merged with any adjacent text nodes. The raw text inside CDATA is preserved without the CDATA wrapper in the JSON output.

Herramientas relacionadas