JSON to XML

Convert JSON data to XML document format.

Convert JSON to XML. Object keys become elements, arrays become repeated elements, and keys starting with @ become attributes, so {"user":{"@id":1,"name":"Ada"}} becomes <user id="1"><name>Ada</name></user>. If the JSON has more than one top-level key or is an array, it's wrapped in a root element you can name. Choose the indent and copy or download the XML.

Common use cases

  • Send JSON data to a system or API that only accepts XML
  • Make XML test data or fixtures
  • Convert config data between formats

How to use

  1. Paste the JSON.
  2. Set the root element name and indent.
  3. Copy or download the XML.

FAQ

How do I make an attribute?

Start the key with @: {"@id": 5} becomes id="5" on the parent element.

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

XML element names can't start with a digit or contain spaces, so rename such keys first.