JSON → XML
Convert a JSON object into an XML document -- customizable attribute prefix, text key, root tag, array wrapping, CDATA, self-closing tags, boolean/null representation, and a well-formedness check.
What this tool does
Paste a JSON object and get back an XML document representing
the same data, using the same @attribute and
#text convention as this site's XML → JSON converter —
so converting one way and then the other returns the original
structure rather than a slightly different one.
Fixing JSON keys that are not valid XML names
JSON keys can be almost anything, but XML element names cannot start with a digit, cannot contain most punctuation, and cannot start with the letters "xml". A key that breaks any of those rules is corrected automatically — invalid characters replaced, a leading underscore added where needed — and every renamed key is listed afterward, showing exactly what changed instead of silently rewriting a name with no record of it.
Controlling exactly how the output looks
- Root tag, attribute prefix, text key, and the tag used for array items are all editable.
- Wrap arrays in a container — wraps repeated values in a single parent element instead of leaving them as plain sibling tags.
- CDATA — wraps text content in a CDATA section instead of escaping it.
- Self-close empty tags, an XML declaration toggle, and a choice of indentation or fully compact output.
Verifying its own output
After generating the XML, it is parsed right back using the browser's own XML parser to confirm it is genuinely well-formed — the result is checked rather than simply assumed to be correct, and the outcome is shown alongside a structure summary of elements, attributes, and nesting depth.
Privacy
Parsing and conversion both happen in your browser. Nothing you paste, drop, or load from a file is sent to a server.