Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Convert a JSON object or array into XML markup.
<root>
<name>Ada</name>
<tags>x</tags>
<tags>y</tags>
</root>This tool converts a parsed JSON value into XML markup, recursively turning each key into a tag and each array into repeated tags sharing the parent key's name -- a common, unambiguous convention for representing JSON data in XML form.
Enter a root tag name and paste a JSON object or array. The resulting indented XML appears instantly.
Each object key becomes an XML tag wrapping its value. An array's items each become a separate tag reusing the array's own key as the tag name (rather than an artificial "item" wrapper), since JSON has no native "repeated element" concept the way XML does.
{"name":"Ada","tags":["x","y"]} with root tag "person" converts to:<person><name>Ada</name><tags>x</tags><tags>y</tags></person>
To go the other direction, see the XML to JSON Converter.
Take a hypothetical object with a name, an address object containing a city, and an orders array holding two objects that each have an id. With root tag "customer", the output opens a customer element, then a name element with its text, then an address element containing a city element, then two separate orders elements, each holding an id element. The array does not get a wrapper such as orders followed by order children; instead the orders tag simply repeats. Objects add one indentation level of two spaces to the lines inside them, so deep structures are easy to read, and each element has its own opening and closing tag.
Strings, numbers and booleans are written as text inside their element, using ordinary string conversion, so true appears as the word true and 12.5 as 12.5. A null value is written as the text null rather than an empty element, which matters if the receiving system expects empty tags for missing data. Ampersands, less-than signs and greater-than signs in values are escaped, but quotation marks are left alone, which is valid inside element text. An empty array produces no output at all for that key, so a key holding an empty list simply vanishes from the XML.
This is the most common source of trouble. The tool does not check or repair key names, so whatever is in the JSON key is used directly as the tag name. XML tag names cannot contain spaces, cannot start with a digit, and cannot include many symbols. A key like "first name" or "2fa" will therefore produce markup that a strict XML parser rejects. Rename such keys to letters, digits, underscores or hyphens beginning with a letter before converting. The root tag field works the same way: choose a valid name, and if you leave it blank the tool falls back to "root".
When the outermost JSON value is an array, each item becomes a sibling element named after the root tag. A well-formed XML document may have only one root element, so a result with several top-level siblings is not a complete document by itself. To get a single valid document, wrap the array in an object first, for example an object with one key called items, and choose a root tag for the wrapper. Primitive top-level values such as a bare number or string are rejected.
Paste the output into the XML Formatter to confirm the structure reads as intended, then validate it against the schema or example your receiving system provided. Every downstream system has its own naming and typing rules, so treat this output as a starting point that follows a common convention rather than a guaranteed match for any particular format.
This converter doesn't create XML attributes -- every JSON key becomes a nested element instead, keeping the conversion simple and predictable.
They're automatically escaped to their HTML/XML entity equivalents (<, &) so the resulting XML stays well-formed.
Yes -- an array at the top level produces multiple sibling elements under the root tag, each named after the root tag itself.
It produces no elements, so that key does not appear in the XML at all.
A null value is written as an element containing the text null.
Keys are used as tag names without changes, and tag names cannot contain spaces or begin with a digit. Rename the keys first.
No. Add one at the top yourself if the receiving system needs it.
Reference: MDN Web Docs