JSON to XML converter
Convert JSON (including JSON Lines) to XML, with objects as elements and arrays as repeated elements. Runs in your browser, free, no sign-up.
Result
Add a JSON file and click Convert. The XML file shows up here.
What to do next
How it works
Add a JSON file and click Convert. Objects become elements, arrays become repeated elements and values become element text. The output is UTF-8 with two-space indentation.
Things to know
XML has no notion of numbers or booleans, so every value is written as text. Keys keep the order they have in the JSON.
Frequently asked questions
How are arrays converted?
As repeated elements with the same name. { "tag": ["a", "b"] } becomes <tag>a</tag><tag>b</tag>. A top-level array is wrapped in <item> elements.
Can I produce attributes?
A key that starts with @ (for example "@id") becomes an attribute, and a "#text" key becomes the element's text. Feeding the Tree output of XML to JSON back in gets you close to the original XML.
What if a key has spaces or special characters?
Characters not allowed in XML names are replaced with _, and a name that starts with a digit gets a leading _. null becomes an empty element (<key/>).
Do my files get uploaded anywhere?
No. Everything runs inside this browser tab and the files never leave your device. The results disappear when you close the page, so save what you need.