JSON to XML Converter

Convert JSON data to XML format — paste JSON and get clean XML output with customizable options

  1. Home
  2. /
  3. JSON to XML Converter

Options

XML Output

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <person>
    <name>John Doe</name>
    <age>30</age>
  </person>
</root>

JSON Size

0 B

XML Size

0 B

Depth

0

Ratio

-

What Is JSON to XML Conversion?

JSON to XML conversion is the process of transforming JSON (JavaScript Object Notation) data into XML (Extensible Markup Language) format. While JSON is the preferred format for modern web APIs and applications, many enterprise systems, SOAP web services, and legacy platforms still require XML for data interchange and configuration.

This converter transforms valid JSON into well-formed XML with full control over the output structure. You can customize the root element name, choose how attributes are detected (via @ prefix, auto-detection of scalars, or no attributes at all), and optionally include an XML declaration header.

Common use cases include preparing data for SOAP API requests that require XML payloads, generating XML configuration files from JSON data sources, converting modern API responses for legacy system consumption, and building XML sitemaps or RSS feeds from structured data.

How to Use This JSON to XML Converter

  1. Paste your JSON — Enter valid JSON in the input textarea. Use the example buttons (Simple, Attributes, Nested, Catalog) to load sample data.
  2. Configure options — Set the Root Element Name, choose the Attribute Detection mode (Auto/@ prefix, All Scalars as Attributes, or All as Elements), and toggle the XML declaration and @ key enforcement.
  3. Review the XML output — The converted XML updates in real time. A summary panel shows JSON size, XML size, depth, and ratio.
  4. Copy or download — Click Copy to copy the XML to your clipboard, or Download to save as a .xml file.

Attribute Detection Modes

Auto (@ prefix)

Keys prefixed with @ in your JSON become XML attributes. All other keys become child elements. This gives you full control over the output.

All Scalars as Attributes

All primitive values (strings, numbers, booleans) become attributes on their parent element. Objects and arrays become child elements.

All as Elements

Every JSON property becomes a child element. No attributes are used. This produces the most verbose but simplest XML output.

Frequently Asked Questions

Is my data sent to a server?

No. All processing is performed locally in your browser. Your data never leaves your device.

How are arrays handled?

Arrays produce multiple sibling elements with the same tag name. For example, {"items": [1, 2, 3]} becomes <items>1</items><items>2</items><items>3</items>.

What does the @ prefix mean?

JSON keys starting with @ (e.g., @id) are treated as XML attributes. This matches the convention used by many JSON-to-XML converters and the reverse XML-to-JSON tool.

Can I convert deeply nested JSON?

Yes. The converter handles nested JSON objects and arrays of arbitrary depth. Each level of nesting becomes a corresponding XML element hierarchy.

Is this tool free to use?

Yes. This tool is completely free with no usage limits or registration required.

Last updated: 9 Jul 2026