How it works
The JSON to XML converter transforms a JSON object or array into an XML document — mapping JSON keys to element names, values to text content, and arrays to repeated elements. Use it to produce XML output for legacy systems, SOAP APIs, RSS feed generators, or configuration files that require XML format.
SOAP web services, enterprise integrations, Microsoft BizTalk, Oracle middleware, and many legacy systems require XML input. When your source data is in JSON (from a modern API or JavaScript codebase), converting to XML enables interoperability with these systems.
How to use it: paste a JSON object or array into the input, or upload a .json file. The tool generates an equivalent XML document. Configure the root element name (wraps the entire output), array element name (the tag name for each item in a JSON array), attribute mapping (specify which JSON keys should become XML attributes rather than child elements), and indentation.
Array handling: a JSON array like [{"name":"Alice"},{"name":"Bob"}] is wrapped in a root element with repeated child elements: <items><item><name>Alice</name></item><item><name>Bob</name></item></items>.
Attribute mapping: specify keys (e.g., id, class) that should be rendered as XML attributes rather than child elements: <item id="1"> vs. <item><id>1</id></item>.
Privacy: JSON-to-XML conversion runs in the browser.
Frequently Asked Questions
- By default, array items use 'item' as the element name: ["a","b"] → <items><item>a</item><item>b</item></items>. You can specify a custom element name in settings. For schema-specific XML (e.g., SOAP envelopes), set the element names to match your target schema.
- List the property names in the 'Attribute keys' field (comma-separated). Any key in that list will be rendered as an XML attribute of its parent element rather than a child element: {"item":{"id":1,"name":"Alice"}} with 'id' as attribute key → <item id='1'><name>Alice</name></item>.
- You specify the root element name in the settings. XML requires exactly one root element, so the entire JSON output is wrapped in that root tag. For {"name":"Alice"} with root 'user' → <user><name>Alice</name></user>. For a JSON array with root 'users' → <users><item>...</item></users>.
- JSON null can be represented as an empty element (<tag/> or <tag></tag>) or with a nil attribute (<tag xsi:nil='true'/> in XML Schema convention). Toggle the null representation style in settings based on your target system's expectations.