JSON to XML
Convert a JSON object or array into XML elements. Paste JSON on the left; the XML output builds on the right as you type.
{ "order": { "@_id": "1042", "status": "shipped", "items": ["pen", "notebook"] } }
becomes
<?xml version="1.0" encoding="UTF-8"?>
<order id="1042">
<status>shipped</status>
<items>pen</items>
<items>notebook</items>
</order>
order is the single top-level key, so it becomes the root element rather than sitting inside a generic wrapper. @_id becomes an id attribute on order. The items array becomes two sibling <items> elements, since XML has no native array type: repetition is the only way to represent one. The <?xml version="1.0"?> line comes from the XML declaration checkbox, on by default; turn it off if your destination doesn’t want a prolog.
Attributes vs. child elements
XML distinguishes attributes from child elements; JSON has only keys. This converter reads any key starting with @_ as an attribute and everything else as a child element or text. If your source JSON doesn’t use that convention, every key becomes a child element, which is usually still valid XML, just more verbose than attribute-heavy documents typically are.
Multiple top-level keys
When the JSON value has more than one top-level key, there’s no single obvious root element, so the converter uses the Root name field (default root) as the wrapper and puts every key underneath it as a child element. Set Root name to match what your XML schema or consumer expects.
Invalid element names
JSON keys can contain spaces, start with digits, or use punctuation that XML element names can’t. "1st place" becomes n1st_place: the leading digit gets an n prefix and the space becomes an underscore. Check the warning strip if your output element names look different from your input keys.