Skip to content
Mediawand

JSON to XML Converter

Produce XML from JSON for a system that only speaks XML. Objects become elements, arrays become repeated elements, and keys starting with @ become attributes, so XML converted to JSON here converts back cleanly.

How to convert JSON to XML

  1. 1Paste your JSON or open a .json file.
  2. 2Set the root element name, the attribute prefix and the indent.
  3. 3Copy the XML or download it as an .xml file.

The root element

XML needs a single root element. If your JSON is an object with one key, that key becomes the root; otherwise everything is wrapped in the root element you name.

Names XML accepts

JSON keys can be anything, but XML names can't contain spaces or start with a digit. Such characters become underscores, so first name becomes first_name and 2024 becomes _2024.

Safe text

Characters like <, > and & are escaped in text and attributes, so the result is always well-formed XML.

Frequently asked questions

Is my data uploaded?
No. Everything runs in your browser, so the JSON never leaves your device.
How do I make an attribute?
Start the key with the prefix you chose, @ by default: {"@id": 5} becomes id="5". Use #text for the element's own text.
What happens to null?
It becomes an empty element, like <note/>.

Related tools

Loading tools…