Convert JSON to XML Online

XML remains the required format for SOAP web services, many enterprise integration buses, RSS/Atom feeds, and government data interchange standards. When your data lives in JSON but the target system expects XML, this converter bridges the gap.

JConvert produces well-formed XML with proper element naming, automatic root-element wrapping, and correct escaping of special characters — all without sending your data to a server.

Paste your JSON, convert, and get standards-compliant XML in seconds.

What this converter does

The tool maps JSON objects to XML elements, arrays to repeated elements, and scalar values to text nodes. If the top-level JSON is an array or has multiple root keys, it is automatically wrapped in a <root> element to produce valid XML.

Special characters like &, <, >, and " are properly escaped. The output includes an XML declaration and uses 2-space indentation.

Common use cases

  • Sending data to SOAP APIs or legacy enterprise systems that require XML
  • Generating RSS or Atom feed entries from JSON data sources
  • Preparing XML payloads for government or financial data interchange (XBRL, HL7)
  • Converting REST API responses to XML for systems that only parse XML
  • Creating XML configuration files from JSON templates

How to use JConvert

  1. Paste or upload your JSON data on the converter page.
  2. Select XML as the output format.
  3. Click Convert and download or copy the XML output.

Notes and limitations

  • JSON keys that are not valid XML element names (e.g. starting with a digit) are prefixed with an underscore.
  • Arrays are converted to repeated elements with the parent key name.
  • Attributes are not generated — all data becomes element content. If you need attributes, post-process the output.
  • Null values produce empty (self-closing) elements.
  • Maximum input size is 10 MB.

Privacy and security

The entire conversion runs client-side in your browser using fast-xml-parser. No data is sent over the network. External entity resolution is disabled by design, so there is no risk of XXE attacks even if your data contains entity references.

Example

JSON input

{
  "book": {
    "title": "1984",
    "author": "George Orwell",
    "year": 1949
  }
}

XML output

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <book>
    <title>1984</title>
    <author>George Orwell</author>
    <year>1949</year>
  </book>
</root>

Ready to convert your data?

Open JSON to XML Converter

Frequently Asked Questions

Does the converter add a root element automatically?
Yes. If your JSON has multiple top-level keys or is an array, a <root> element is added to ensure valid XML.
Can I convert XML back to JSON?
Yes. JConvert supports XML-to-JSON conversion as well. See the XML to JSON tool.
Are XML attributes supported?
The converter maps all JSON values to element content. XML attributes are not generated. If you need attributes, you can adjust the output manually.
Is the output safe from XXE attacks?
Yes. The fast-xml-parser library used by JConvert does not support DTDs or external entities, making XXE attacks impossible.
Does my data leave my browser?
No. Everything is processed client-side. Your data stays on your machine.

Related tools

Read guides on the blog →