Developer Tools

JSON to XML Converter

Convert JSON into indented, well-formed XML for SOAP services, legacy integrations and configuration files.

Free to use Browser-based processing Instant results

Input JSON

Paste your JSON or upload a JSON file.

INPUT

Generated Output

Your converted code will appear here.

OUTPUT

            

Conversion Format

Select the output format you need.

FORMAT

About the JSON to XML Converter

Convert JSON into indented, well-formed XML for SOAP services, legacy integrations and configuration files.

Many enterprise systems, SOAP web services and older integrations still expect XML. This converter turns a JSON document into indented XML under a <root> element. Each key becomes an element, arrays become repeated elements, and characters such as & and < are escaped so the result is well-formed.

How to use it

  1. Paste a JSON sample into the input editor or upload a .json file.
  2. Select Convert.
  3. Review the output, then copy it or download it.

How JSON types are mapped

JSON valueGenerated as
key: value<key>value</key>
nested objectnested child elements
array "tags": [a, b]repeated elements <tags>a</tags><tags>b</tags>
top-level array<item> elements inside <root>
nullan empty element <key/>
& < > " 'escaped as &amp; &lt; &gt; &quot; &apos;

Example

This input:

{
  "id": 1,
  "name": "Ada",
  "price": 9.99,
  "active": true,
  "tags": ["new", "sale"],
  "address": { "city": "London", "zip": "N1" }
}

produces this output:

<root>
  <id>1</id>
  <name>Ada</name>
  <price>9.99</price>
  <active>true</active>
  <tags>new</tags>
  <tags>sale</tags>
  <address>
    <city>London</city>
    <zip>N1</zip>
  </address>
</root>

Limitations and things to review

Notes about the generated XML:

  • Everything becomes an element. XML attributes aren't generated.
  • Characters that aren't allowed in XML element names (spaces, @, $ and so on) are replaced with an underscore, and names that start with a digit get a leading underscore.
  • Data types aren't preserved. 42, "42" and true all become plain element text, so the receiving system must know how to interpret them.
  • An empty array produces no element at all, so it can't be told apart from a missing key.

Frequently Asked Questions

Repeating the element (<tags>a</tags><tags>b</tags>) is the most common convention for JSON-to-XML mapping and is what many XML deserializers expect for collections. If your schema requires a wrapper element, add it around the repeated items.

Yes. Values are escaped and invalid element names are made safe, so the result is well-formed XML. Whether it matches a specific XSD schema depends on that schema's element names and order.

No. The conversion runs in your browser with JavaScript, and your JSON isn't sent to or stored on DevToolsWorld servers.

The converter shows the parser's error message instead of output. Use the JSON Formatter to validate and fix the document, then convert it again.

Yes. It's free and doesn't require an account or any installation.