JSON to XML Converter
Wrap JSON data in well-formed XML elements.
JSON
XML
About the JSON to XML converter
This converter maps a JSON document onto XML elements: object keys become tags, arrays repeat a chosen item element, and scalar values become text content.
Special characters are escaped, and keys that are not legal XML names are sanitised, so the result always parses.
The mapping
An object becomes an element per key. An array becomes a wrapper element containing one repeated child per entry — that child is named by the "Array item element" setting.
Nulls become self-closing elements marked `null="true"`, which distinguishes them from empty strings when you convert back.
Element name safety
XML names cannot contain spaces or most punctuation, and cannot start with a digit. Keys that break those rules have illegal characters replaced with underscores and, if needed, get a prefix so the document stays well-formed.
Frequently asked questions
Can I produce attributes rather than child elements?
Not in this direction — every value becomes an element. The XML to JSON converter does read attributes, prefixing them with @.
Is the XML declaration included?
Yes, a UTF-8 declaration is written at the top. Delete the line if the consumer does not want it.