🏷️ JSON to XML Converter
Paste JSON and get well-formed XML, object keys become elements, arrays repeat their tag, and you choose the root name.
attributes are not generated, keys become elements
How the json to xml converter works
Each object key becomes an element of that name; array items repeat the parent tag; primitive values become text content with &, < and > escaped. Keys that are not valid XML names fall back to <item>. The output opens with a standard XML declaration and nests with two-space indentation. Walking the sample: the array of two person objects nests inside your chosen root element, each object becoming a <name>, <role> and <active> element pair, and a value such as Doe & Jane is written as Doe & Jane so the document stays well-formed. A valid XML name must start with a letter or underscore and contain no spaces, which is why keys like "first name" are replaced by <item>.
This direction serves legacy integrations, systems and endpoints that still speak XML while your data lives as JSON. Note that the conversion generates elements only: if a target schema requires specific attributes, they need manual placement, since JSON has no attribute concept to translate from.
Frequently asked questions
How are arrays converted?
By repeating the element: {"book": [a, b]} produces two <book> elements in sequence, the standard XML idiom for lists.
Can the converter produce attributes?
No, JSON has no attributes, so everything becomes elements. Schemas requiring attributes need a post-edit or a mapping convention agreed with the consumer.
What happens to special characters?
&, < and > are escaped to their entities in text content, keeping the output well-formed regardless of the data.
What if my JSON keys contain spaces?
Invalid XML names are replaced with <item> to keep the document well-formed, rename keys beforehand if the tag names matter (the find & replace tool works on JSON text too).
Why must I set a root element name?
A well-formed XML document must have exactly one outermost element, but a JSON array or a multi-key object has none. The root name you supply (default "root") wraps everything so the output is a single valid document rather than several sibling fragments.
Are numbers and booleans quoted in the XML?
No, XML has no types, so every value becomes plain text content. The number 1965 is written as the characters 1965 inside its element; any consumer decides how to interpret it, exactly as with a hand-written XML file.
Local processing?
Yes, no upload, no limits, offline-capable.