Converter Knowledge Base

JSON to XML Converter: Transform JSON Data to XML Format

Convert JSON to XML online instantly. Handles nested objects, arrays, and attributes. Free converter for SOAP APIs, legacy systems, and config files.

Why Convert JSON to XML?

While modern APIs use JSON, many enterprise systems, legacy SOAP services, and data warehouses still require XML format. Converting JSON to XML is common when integrating modern microservices with older enterprise infrastructure.

JSON to XML Conversion Rules

  • JSON objects become XML elements: {"name":"Alice"} → <name>Alice</name>
  • JSON arrays become repeated elements with the parent key name
  • Nested objects become nested elements
  • Numeric/boolean values are converted to element text content
  • JSON null → self-closing empty element: <field/>

Common XML Output Use Cases

  • SOAP API integration: REST JSON → SOAP XML payload
  • Legacy enterprise databases (IBM DB2, SAP, Oracle) requiring XML feeds
  • RSS/Atom feed generation from JSON data
  • Android layout configuration from JSON design specs
  • Maven/Ant build file generation from JSON configurations
json
// JSON Input
{
  "person": {
    "name": "Alice",
    "age": 28,
    "roles": ["admin", "editor"]
  }
}

// XML Output
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <person>
    <name>Alice</name>
    <age>28</age>
    <roles>admin</roles>
    <roles>editor</roles>
  </person>
</root>

Try the free JSON to XML

Runs entirely in your browser — no upload, no signup, and your data never leaves your device.

Open JSON to XML

Frequently Asked Questions

Does the JSON to XML converter handle arrays?

Yes. JSON arrays are converted to repeated XML elements with the parent key name. Each array item becomes a separate element.

Can I convert XML back to JSON?

Yes. Switch the direction selector to XML → JSON and paste your XML: element names become object keys, text is coerced to numbers and booleans where it looks like one, and repeated sibling elements collapse into an array. Attributes are not carried across.

Does the XML output include an XML declaration?

Yes. The output includes the standard <?xml version="1.0" encoding="UTF-8"?> declaration at the top.

Tools mentioned in this guide

Related JSON Topics & Reference Articles