JSON to XML Converter

FreePrivateInstant
JSON input
XML output
Ctrl+Enter Convert to XML

JSON to XML Converter

Convert any JSON object or array to well-formed XML in one click. Special characters are escaped, arrays become repeated elements, and null values use the standard xsi:nil attribute. Set your own root element name and download the result as an .xml file. Runs entirely in your browser.

Where Is This Useful?

Legacy system integration
Many enterprise systems, SOAP APIs, and ERP platforms only accept XML. Convert a modern JSON payload to XML before sending it to a legacy endpoint without writing a custom serializer.
XSLT and XML pipelines
If your data pipeline involves XSLT transformations or XML-based message brokers, you need XML input. Start from your JSON source and get valid XML ready for your pipeline instantly.
Config and data export
Tools like Maven, Ant, Spring, and many CI systems use XML config. Converting a JSON config draft to XML format saves time when the target tool expects XML but your workflow produces JSON.

How to Use

  1. Paste a JSON object or array in the input panel
  2. Set the root element name (defaults to root)
  3. Click Convert to XML or press Ctrl+Enter
  4. Copy the XML output or download as an .xml file

Conversion Rules

  • Output starts with <?xml version="1.0" encoding="UTF-8"?>
  • JSON objects become nested XML elements
  • JSON arrays become repeated elements with the same tag name
  • Strings with &, <, > are escaped automatically
  • Null values rendered as <tag xsi:nil="true"/>
  • Invalid tag names (digits, spaces) are sanitized with underscores

Frequently Asked Questions

Does it add an XML declaration?

Yes. Every output starts with <?xml version="1.0" encoding="UTF-8"?> so the result is a complete, valid XML document.

How are JSON arrays converted?

Each item in a JSON array becomes a repeated element with the same tag name as the array key. For example, "items": [1, 2] becomes two <items> elements.

Are special characters escaped?

Yes. Characters like &, <, >, ", and ' are escaped to their XML entity equivalents.

Can I also convert XML back to JSON?

Yes. Use the XML to JSON Converter to go the other direction.

Is my JSON uploaded anywhere?

No. Everything runs locally in your browser. Your data never leaves your machine.

Related Tools