JSON to XML

Convert JSON to XML

About JSON to XML

Converts JSON into XML following the compact convention of the xml-js library: an _attributes object becomes element attributes, _text becomes the text content, and arrays become repeated elements. It is the inverse of the XML to JSON tool.

When you would use it

How to use it

  1. Paste JSON (JSON5 syntax is accepted) into the left field.
  2. Read the XML on the right.
  3. Copy the result.

Things worth knowing

Frequently asked questions

Why does the output have no XML declaration?
One is only written when the JSON has a _declaration key, for example {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"root":{...}}.
How do I set attributes on an element?
Give the element an object value with an _attributes key holding the attributes and, if needed, a _text key for its text content.

All the tools