Conversor de XML para JSON
Converta XML para JSON formatado com suporte a atributos, CDATA, elementos aninhados e múltiplos filhos. Grátis, privado e instantâneo.
How It Works
Paste XML
Copie e cole qualquer documento XML na área de entrada. O exemplo fornece um caso realista com elementos aninhados e CDATA.
Auto-Convert
The XML is parsed and converted to JSON instantly as you type. Attributes get an @ prefix and text nodes use #text.
Review JSON
The formatted JSON output is pretty-printed with 2-space indentation. Nested structures and arrays are clearly visible and easy to navigate.
Copy or Download
Copy the JSON to your clipboard with one click, or download it as a .json file for use in your projects.
About XML to JSON Converter
Convert XML documents to clean, structured JSON format instantly using browser-native DOMParser. This tool follows the standard xml2json convention — attributes are prefixed with @, text content is stored in #text when mixed with child elements, and multiple child elements with the same name are grouped into arrays. CDATA sections are treated as text content. The JSON output is pretty-printed with 2-space indentation for readability. All processing happens in your browser — no data is sent to any server.
Suporte a Atributos
Os atributos XML são preservados com a convenção padrão de prefixo @. Múltiplos atributos em um elemento são todos incluídos como chaves separadas.@ prefix convention. Multiple attributes on one element are all included as separate keys.
Tratamento de CDATA
As seções CDATA são tratadas como conteúdo de texto e incluídas na saída. O texto bruto dentro das seções CDATA é preservado sem análise.
Suporte a Aninhamento e Arrays
Elementos profundamente aninhados tornam-se objetos aninhados. Nomes de elementos repetidos no mesmo nível são automaticamente agrupados em arrays.
100% Privado
Toda a conversão acontece no seu navegador usando DOMParser nativo. Nenhum dado é enviado para qualquer servidor. Funciona offline após o carregamento da página.