JSON to XML Converter
Donfig converts JSON documents into well-formed XML in your browser. Useful when integrating with legacy systems, SOAP APIs, or data pipelines that expect XML inputs. Object keys become element names; nested objects become nested elements; arrays produce repeated elements with the array name. The converter wraps your input in a synthetic root element when needed (XML requires exactly one root, JSON does not), and emits the standard XML 1.0 prolog. Output indentation is configurable. As with every Donfig tool, conversion runs client-side — your data never leaves the browser.
JavaScript is required to use the live tool. Please enable JavaScript and reload.
Frequently asked
Does the converter add an XML declaration?
Yes: <?xml version="1.0" encoding="UTF-8"?> is prepended to the output.
How are JSON arrays represented in XML?
As repeated elements with the same parent name. So [{a:1},{a:2}] under key items becomes <items>...<items><a>1</a></items><items><a>2</a></items>.
What about XML attributes?
The reverse converter (XML to JSON) maps attributes to _attributes keys. The forward direction (JSON to XML) treats any key starting with _attributes as XML attributes on the parent element.