JSON to XML Converter

Convert JSON data into clean, well-formatted XML in your browser.

JSON Input

Ln 1, Col 1Empty

XML Result

Your XML will appear here.
No result yet

What Is a JSON to XML Converter?

A JSON to XML converter changes JSON data into XML (Extensible Markup Language) format. Many older systems, APIs, and enterprise tools still use XML, so converting JSON to XML helps you share data between modern and legacy applications.

How to Convert JSON to XML

  1. Paste your JSON into the JSON Input box, click Upload, or click Sample to try an example.
  2. Optionally change the root tag name and indentation.
  3. Click Convert to XML.
  4. Click Copy or Download to save the XML.

Features

  • Converts JSON objects and arrays into well-formatted XML.
  • Turns each JSON key into an XML tag automatically.
  • Repeats tags for array items, which is the standard XML style.
  • Escapes special characters like &, < and > safely.
  • Fixes invalid key names, such as keys with spaces or starting with numbers.
  • Runs in your browser, so your data is not uploaded to a server.

Example

JSON
{
  "id": 7,
  "name": "Emily & Co",
  "tags": ["admin", "editor"],
  "address": { "city": "London" },
  "manager": null
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <id>7</id>
  <name>Emily &amp; Co</name>
  <tags>admin</tags>
  <tags>editor</tags>
  <address>
    <city>London</city>
  </address>
  <manager/>
</root>

How JSON Maps to XML

  • Objects become nested elements, like address → <address><city>.
  • Arrays repeat the tag once per item, so tags becomes two <tags> elements.
  • null becomes an empty element such as <manager/>.
  • Special characters are escaped: & becomes &amp;.
  • XML needs one root element, so everything is wrapped in <root>. You can change its name.

XML has no data types, so numbers and true/false become plain text. If the receiving system needs types, it usually reads them from an XML Schema (XSD).

When You Still Need XML

Many older and enterprise systems only accept XML: SOAP web services, banking and payment formats, government reporting, RSS feeds and some e-commerce product feeds. Convert your JSON here, check the result with the XML Formatter, and go back the other way with XML to JSON.

Frequently Asked Questions

How are JSON arrays converted to XML?

Each item in an array becomes a separate tag with the same name. For example, {"books": [{"title": "A"}, {"title": "B"}]} creates two <books> elements, one for each book.

What is the root tag?

Every XML document needs one main tag that wraps all other tags. If your JSON starts with an array, the items are placed inside this root tag. You can change its name in the Root tag box.

What happens to invalid key names?

XML tag names cannot contain spaces or start with a number. Such characters are replaced with an underscore, and an underscore is added at the start when needed, so the XML stays valid.

Is this JSON to XML converter free?

Yes. It is free to use and does not require sign-up.