ModernCalcs

JSON to XML Converter

Convert JSON objects to well-formed XML. Nested objects become child elements; arrays expand to repeated <item> tags. Special characters are escaped automatically.

JSON Input

XML Output

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <person>
    <name>Alice</name>
    <age>30</age>
    <active>true</active>
    <item>admin</item>
    <item>user</item>
    <address>
      <city>New York</city>
      <zip>10001</zip>
    </address>
  </person>
</root>

JSON to XML Converter: Nested Objects to Elements

Converting JSON to XML is essential when integrating with legacy SOAP APIs, RSS feeds, or XML configuration files. This tool recursively maps JSON structure to XML elements — objects become parent-child tags, arrays expand to repeated elements, and special characters are safely escaped per the XML specification.

Frequently Asked Questions

How are JSON arrays converted to XML?

Each array element becomes a repeated child tag. For example `"tags": ["a","b"]` becomes `ab`.

What happens to null values?

JSON null values produce empty elements: `"field": null` becomes ``.

Are special characters escaped?

Yes. &, <, and > in string values are escaped to &, <, and > to produce valid XML.

What is the root element?

The top-level JSON object is wrapped in a element with an XML declaration header.

Does it support XML attributes?

No — JSON keys are mapped to child elements, not XML attributes. For attribute-based XML a schema-driven converter is needed.

Can I convert XML back to JSON?

This tool is one-directional (JSON → XML). Use a dedicated XML to JSON converter for the reverse.