Convertools Dev
All tools

Convert JSON to XML

Turn a JSON object into an indented XML document.

JSON input

Paste text or drop a file here (up to 50 MB).

XML result

Free to use. Your input stays in this browser.

How to use it

  1. Paste JSON or drop a .json file.
  2. Choose the XML indentation.
  3. Copy the result or download it as an .xml file.

Mapping: "@id": "1" becomes the attribute id="1", "#text" becomes the element text, an array repeats the element for each item, and null becomes an empty element such as <note/>.

A JSON object with one key becomes the root element. Anything else, such as an array or an object with several keys, is wrapped in <root>. Keys that are not valid XML names are adjusted, so "first name" becomes <first_name>.

Example

JSON input
{"catalog":{"book":[{"@id":"b1","title":"XML Basics","price":{"@currency":"USD","#text":"29.99"}},{"@id":"b2","title":"Fish & Chips","price":{"@currency":"EUR","#text":"12.50"}}]}}
XML result
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
  <book id="b1">
    <title>XML Basics</title>
    <price currency="USD">29.99</price>
  </book>
  <book id="b2">
    <title>Fish &amp; Chips</title>
    <price currency="EUR">12.50</price>
  </book>
</catalog>