Convertir JSON a XML
Convierte JSON en XML con sangría. Los arrays pasan a elementos repetidos, las claves con @ a atributos y #text al texto del elemento.
Entrada
Consejo: Ctrl + Intro para ejecutar
Ajustes guardados
Por ahora, la ayuda detallada de abajo solo está disponible en inglés.
Acerca de esta herramienta
Older APIs, SOAP services, office formats and many enterprise systems still expect XML. This converter turns JSON into readable, indented XML using simple, predictable rules: object keys become elements, arrays become repeated elements with the same name, keys beginning with @ become attributes and a #text key becomes the element’s text.
Because the rules match our XML to JSON converter, you can convert in one direction, edit, and convert back without surprises.
Cómo usarla
- Paste the JSON.
- Enter a root element name (used when the JSON has more than one top-level key or is an array).
- Run it and copy or download the XML.
Cómo funciona el cálculo
The JSON is parsed and walked recursively. Strings, numbers and booleans become element text (escaped). Keys starting with @ are written as attributes on the parent element; arrays repeat the element for each item. An XML declaration with UTF-8 encoding is added.
object → element · array → repeated elements · @key → attributeEjemplo práctico
An integration developer converts an invoice object with an @number attribute, a client name and an array of two lines. The result is <invoice number="A-17"> containing <client>Northwind</client> and two <line> elements, each with <item> and <qty>.
Limitaciones
- No XSD validation or namespace management.
- Mixed content (text and elements interleaved) is limited to #text.
- Very large JSON may be slow to render.
Última actualización:
Preguntas frecuentes
How are invalid element names handled?
Keys that are not valid XML names are adjusted so the output is well formed.
Can I create namespaces?
Use keys such as "@xmlns:x" and "x:element"; they are written as given.
Does it validate against a schema?
No. It produces well-formed XML, not schema-valid XML.
Solución de problemas
The root element is missing.
With a single top-level key, that key is the root; otherwise the root name you entered is used.
Numbers lost decimals.
JSON numbers are written as they parse; quote them to keep exact formatting.
Error: invalid JSON.
Check the JSON with the JSON formatter.
Privacidad & Uso gratuito
¿Se guardan mis datos?
Tus datos permanecen en esta pestaña. No recibimos archivos, textos ni valores de cálculo.
¿Esta herramienta es gratis?
Sí. No requiere registro ni pago.
Ver también
Otras herramientas útiles
Convertir JPG a PNG
Convierte imágenes JPG a PNG en tu navegador, hasta 30 a la vez. PNG conserva cada píxel y admite transparencia, ideal para capturas, logotipos y gráficos.
Conversores de archivosConvertir PNG a JPG
Convierte imágenes PNG a JPG en tu navegador, hasta 30 a la vez. Los JPG pesan poco y se abren en todas partes, ideales para fotos y formularios; las zonas transparentes pasan a blanco.
Conversores de archivosConvertir WebP a JPG
Convierte imágenes WebP a JPG en tu navegador, hasta 30 a la vez. Los JPG pesan poco y se abren en todas partes, ideales para fotos y formularios; las zonas transparentes pasan a blanco.
Conversores de archivos