JSON to XML Converter
NOVOConvert JSON to XML in your browser: set the root name, array style, @attributes, declaration and indentation.
Funciona 100% no seu navegador — o que você insere nunca é enviado nem armazenado nos nossos servidores.
Esta ferramenta ainda não está totalmente traduzida, por isso parte do texto continua em inglês. A ferramenta funciona da mesma forma em todos os idiomas.
Conventions: a key that starts with @ becomes an attribute ({"@id": 7} → id="7"); the key #text is the text of an element that also has attributes or children; null and empty values become an empty element (<a/>); a top-level array is written as <item> elements inside the root. Names that XML does not allow (spaces, a leading digit) are renamed and listed in a notice.
Exemplos rápidos
Entradas típicas e os resultados que esta ferramenta gera.
Visão geral
JSON to XML Converter writes a JSON document as well-formed XML. Objects become nested elements, values are escaped (& < > and quotes), and you decide the root element name, whether to add an XML declaration, and whether the output is pretty-printed or minified.
JSON has arrays and XML does not, so you choose how they appear: repeat the parent name for each entry, or wrap entries in <item> elements. A key that starts with @ becomes an attribute and #text holds the text of an element that also has attributes. Keys that XML forbids are renamed and listed in a notice.
It runs in your browser; your JSON is not uploaded.
Por que usar esta ferramenta?
- Produces escaped, well-formed XML for SOAP, feeds and legacy systems
- Both common array conventions are available
- Attributes and mixed text are possible with @ and #text keys
- Invalid element names are repaired and reported, not silently broken
Recursos
Root name
Set the root element, or let a single top-level key become the root.
Array style
Repeat the element name for each item, or wrap items in <item>.
Attributes
Prefix a key with @ to write it as an attribute; use #text for element text.
Escaping and names
Special characters are escaped and illegal names are renamed with a notice.
Declaration and indent
Toggle the XML declaration; pretty-print with 2 spaces, 4 spaces, tab, or minify.
Copy or download
Copy the XML or save a .xml file.
Como usar
Add your JSON
Paste or open a .json file, or press Load sample.
Set the root and arrays
Type a root name and choose how arrays are written.
Mark attributes
Write {"@id": 7} to get id="7" on the element, and "#text" for element text.
Copy or download
Pick the output style, then Copy or Download .xml.