Saltar al contenido
uencoder

Convertir XML to JSON and back

Translate entre XML y JSON para interoperability con heredado APIs, preserving attributes, namespaces, y mixed content.

  1. 1

    XML and JSON have different models: XML has attributes, namespaces, and mixed content; JSON has only objects, arrays, and scalars. Conversion requires conventions for representing attributes (e.g. @attr) and text content (e.g. #text).

  2. 2
    Conversor JSON ↔ XML →

    Paste XML to get JSON, or JSON to get XML. The tool uses a consistent convention for attributes and text nodes, and handles namespaces by prefixing.

  3. 3

    Use the chain to convert JSON→XML with pretty-printing and proper declaration, for sending to XML-expecting APIs.

  4. 4
    Formateador XML →

    Formatear or minify XML independently — useful when the XML is valid but hard to read, or needs compression for transport.

Preguntas frecuentes

Why do attributes look different in the JSON?
XML attributes have no direct JSON equivalent. Converters typically prefix them (e.g. @id for attribute id) or nest them under a special key. The convention varies by tool — check the output structure before consuming it.
Can all XML be converted to JSON?
Most XML can, but mixed content (text interspersed with child elements, like <p>Hello <b>world</b></p>) is awkward in JSON and requires array conventions. Namespaces and processing instructions may also be lost or represented differently.

Flujos que resuelven esta tarea

Herramientas relacionadas