JSON to XML Converter

Convert JSON to XML


          

What Is This Tool?

The JSON to XML Converter turns a JSON document into an indented XML document. Object keys become child elements, arrays repeat the parent key once per item, and scalar values become element text content. Choose the name of the wrapping root element yourself. Conversion runs entirely in your browser — nothing is uploaded.

How to Use

1

Paste your JSON into the input box.

2

Set a root element name, or keep the default "root".

3

Click Convert to generate the XML.

4

Copy the result or download it as a .xml file.

Features

  • Custom root element name
  • Arrays repeat the parent key as sibling elements
  • Invalid XML tag characters are sanitized automatically
  • Text content is properly XML-escaped
  • Copy to clipboard or download as a file
  • 100% client-side — nothing leaves your browser

Examples

Input JSON:

{
  "name": "Widget",
  "tags": ["new", "sale"]
}

Output XML (root name "product"):

<product>
  <name>Widget</name>
  <tags>new</tags>
  <tags>sale</tags>
</product>

Common Use Cases

  • Feeding a JSON API's response into a system that expects XML
  • Generating XML config or feed samples from JSON data
  • Migrating a JSON data source to an XML-based integration
  • Quickly comparing JSON and XML representations of the same data

Frequently Asked Questions

Is my JSON uploaded anywhere?

No. Conversion happens locally in your browser. Nothing is sent to a server.

What happens with arrays?

Each item in a JSON array is output as a separate sibling element repeating the array's key name, in the order they appear.

What if a JSON key isn't a valid XML tag name?

Invalid characters are replaced with an underscore, and an underscore is prefixed if the key starts with a digit, so the output is always well-formed.

How are null values handled?

A null or undefined value becomes a self-closing empty element with no text content.

Can I choose the root element name?

Yes, enter any name in the Root Element Name field before converting; it defaults to "root" if left blank.

Can I download the converted XML?

Yes, click Download to save the current output as a data.xml file.