JSON to XML Converter
Convert any JSON object to a well-formed XML document instantly. Set a custom root element, and copy or download the output as a .xml file.
<?xml version="1.0" encoding="UTF-8"?>
<root>
<person>
<name>Alice</name>
<age>30</age>
<email>alice@example.com</email>
<hobbies>reading</hobbies>
<hobbies>coding</hobbies>
<hobbies>hiking</hobbies>
</person>
</root> Como funciona
Fórmula
Recursive DOM serialization: each JSON key becomes an XML element Exemplo prático
{"person":{"name":"Alice","age":30}} converts to <root><person><name>Alice</name><age>30</age></person></root>
JSON vs. XML: When to Convert
While JSON is the dominant format for modern REST APIs, XML remains standard in:
- Enterprise integrations (SOAP web services, EDI systems)
- Document formats (XHTML, SVG, Microsoft Office XML)
- Configuration files (Maven
pom.xml, AndroidAndroidManifest.xml) - Legacy system APIs that predate JSON adoption
Converting JSON to XML allows you to bridge modern JSON-producing systems with XML-consuming integrations without writing custom serialization code.
XML Naming Conventions
XML element names must start with a letter or underscore and cannot contain spaces. The root element name you configure is automatically sanitized to remove invalid characters.
Perguntas frequentes
How are JSON arrays converted to XML?
Each array item becomes a separate element with the array's key name as the tag. For example, 'hobbies: ["reading","coding"]' becomes <hobbies>reading</hobbies><hobbies>coding</hobbies>.
Does the converter handle nested JSON?
Yes. Nested objects and arrays are recursively converted, preserving all nesting levels in the output XML.
What happens to null values?
JSON null values are rendered as self-closing empty tags, e.g. <field/>, which is standard XML convention for absent or null values.
Does the output include an XML declaration?
Yes. The output always includes the standard <?xml version="1.0" encoding="UTF-8"?> declaration as the first line.
Ferramentas relacionadas
← Ver todas as ferramentas de outras calculadorasContador De Dias Calculator
pt-BR: dias entre duas datas (incluir ultimo dia), dias ate uma data futura (contagem regressiva), somar/subtrair dias.
Calculadora De Horas Trabalhadas Calculator
pt-BR: rows of entrada, saida, intervalo -> horas do dia; week/month total; hora extra above jornada (default 8h/44h); output hh:mm and decimal.
Calculadora Entre Datas Calculator
pt-BR: diferenca entre duas datas in anos/meses/dias, total dias/semanas/meses; adicionar/subtrair periodo.
Calculadora De Investimentos Calculator
pt-BR: aporte inicial, aporte mensal, taxa (a.a. or a.m. toggle), prazo -> montante = FV with contributions; optional IR regressivo (22.5% up to 180d, 20% 181-360d, 17.5% 361-720d, 15% >720d); CDI/Selic/poupanca reference rates come from data/rates.json and are editable, never hard-coded.
Calculadora De Pace Calculator
Same logic as pace calculator, native pt-BR UI/copy: ritmo por km/milha, provas (5K,10K,21K,42K).