JSON to XML Converter
Paste JSON and convert it to structured XML instantly. Nested objects become nested elements, arrays produce repeated sibling elements, and the root element name is configurable.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON to XML Converter?
JSON and XML are both formats for structured data, but they serve different ecosystems. JSON is the standard for web APIs and modern applications; XML is dominant in enterprise systems, SOAP services, Android resources, configuration files, and many legacy integrations. Converting between them is a routine task when bridging these worlds.
This tool recursively maps JSON to XML: objects become parent elements with children, arrays become repeated sibling elements with the parent's key as the tag name, and scalar values become text content. Keys that are invalid XML element names are automatically sanitised. The root element name is configurable to match your target schema.
How to Use JSON to XML Converter
Paste JSON into the input area or click "Load Sample"
Set a root element name (default: root)
Toggle the XML declaration on or off
Choose 2 or 4 space indentation
Copy or download the XML output
Common Use Cases
- Developers converting JSON API responses to XML for consumption by SOAP-based enterprise services.
- Engineers transforming JSON configuration to XML format required by Java or .NET frameworks.
- Architects migrating data from JSON-based APIs to XML-based data interchange formats.
- Developers generating Android XML resources (strings.xml, etc.) from JSON source data.
- Teams converting JSON data files to XML for XSLT transformation pipelines.
- Data engineers transforming JSON exports to XML for import into XML databases or legacy systems.
Example Input and Output
A JSON configuration object with nested structure and an array is converted to well-formed XML.
{
"server": {
"host": "localhost",
"port": 8080
},
"tags": ["api", "v2", "stable"]
}<?xml version="1.0" encoding="UTF-8"?>
<root>
<server>
<host>localhost</host>
<port>8080</port>
</server>
<tags>api</tags>
<tags>v2</tags>
<tags>stable</tags>
</root>Privacy
All conversion runs in your browser. No data is uploaded to any server.
Attribute vs element style
This converter uses the element-per-value style (child elements for all values). Some XML schemas use attributes for simple values. If your target schema requires attributes, post-process the output or use an XSLT transform to convert child elements to attributes.

