RevealTheme logo

Conversor de XML a JSON

Convierte documentos XML a JSON. Los atributos se convierten en claves con prefijo @; las etiquetas repetidas se convierten en arrays.

Cómo usar esta herramienta

  1. 1

    Paste or type your XML into the input box.

  2. 2

    Read the converted JSON in the output panel below, which updates as you type.

  3. 3

    If the XML is malformed, fix the error shown in red and the output will reappear.

  4. 4

    Select the JSON from the output panel to copy it into your project.

¿Qué es el Conversor de XML a JSON?

Pasar de XML a JSON tiene pérdidas en algunos aspectos: XML admite espacios de nombres, instrucciones de procesamiento y secciones CDATA que no tienen equivalentes directos en JSON. Este conversor gestiona el 90 % de los casos: elementos anidados, atributos (con prefijo @) y contenido de texto (#text). Para XML complejo, puede ser necesaria una biblioteca dedicada.

Casos de uso comunes

  • Inspect a SOAP or legacy XML API response as JSON before wiring it into a JavaScript front end.

  • Convert an RSS or Atom feed snippet into JSON to prototype a parser quickly.

  • Turn a config file or build manifest written in XML into JSON to eyeball its structure.

  • Pull values out of an XML sitemap or data export when a JSON shape is easier to traverse.

  • Teach or learn how attributes, repeated tags, and text nodes map between the two formats.

  • Sanity-check that a small XML payload is well-formed, since malformed input shows a parser error.

Preguntas frecuentes

¿Qué es el prefijo @?
Los atributos se almacenan como @nombreatributo para distinguirlos de los elementos hijos con el mismo nombre.

Herramientas relacionadas