Skip to content
Zoyku

JSON to XML

Convert JSON to well-formed XML with attributes, repeated elements and correct escaping — round-trips with our XML to JSON tool. All local, all instant.

Root element

This tool runs entirely in your browser. Your data never leaves your device — it is not uploaded to any server.

How to use

  1. 1Paste your JSON into the input box.
  2. 2The XML appears live — set a custom root element name if you need one.
  3. 3Copy the result or download it as an .xml file.

JSON to XML

Paste JSON and get a pretty-printed XML document with a proper declaration and 2-space indentation. Objects become elements, arrays repeat their key once per item, and "@key" members become XML attributes — the exact inverse of our XML to JSON converter, so data can go there and back.

Everything is escaped by the book (& < > " ') and arbitrary keys are coerced into legal element names, so the output is always well-formed XML. Values XML cannot express — null, empty arrays — become empty elements, and the limits are spelled out below.

Frequently asked questions

How do attributes and arrays map to XML?

A key starting with @ (or @_) becomes an attribute of its parent element, and "#text" becomes the element's text content — matching what our XML to JSON tool emits. Arrays repeat the same element once per item; a JSON array at the very top is wrapped as <root><item>…</item></root> because a document needs a single root.

What are the limits of the JSON ⇄ XML mapping?

XML has no notation for null or for empty arrays — both collapse to empty elements. Mixed content (text interspersed with child elements) cannot round-trip: text is kept as one block. And when parsing back, a lone repeated element becomes a plain value rather than a one-item array.

What happens to keys that aren't valid XML names?

They are coerced: illegal characters become underscores and a key starting with a digit gets a leading underscore ("2fa" → <_2fa>). CJK and accented letters are already legal XML names and are kept as-is.

Embed this tool

Put this tool on your own site with one line — it runs entirely in the visitor's browser.

<iframe src="https://zoyku.com/en/tools/json-to-xml?embed=1" width="100%" height="640" style="border:0;border-radius:16px" title="Zoyku — json-to-xml" loading="lazy"></iframe>
100% local processing