Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/json-to-xml" width="100%" height="700" frameborder="0" title="JSON to XML Converter"></iframe>

JSON to XML Converter

Convert JSON to well-formed XML instantly. Customizable root element name, attribute handling, pretty-print indentation, and full support for arrays, nested objects, and primitives. Everything runs in your browser — your data stays private.

Options
 
Drop JSON file here
Converted XML will appear here...

About JSON to XML Conversion

JSON (JavaScript Object Notation) is the dominant data format for modern APIs, configuration files, and web applications. XML (eXtensible Markup Language) remains essential for SOAP web services, RSS/Atom feeds, configuration files in Java and .NET ecosystems, document formats like SVG and XHTML, and legacy enterprise integrations. Converting JSON to XML is a common requirement when integrating modern systems with older infrastructure or working with XML-centric tools.

This converter handles the full range of JSON data types including strings, numbers, booleans, null values, nested objects, and arrays of any depth. The output is well-formed XML that can be validated by any XML parser. Special characters in values are properly escaped using XML entities.

Key Features

How Arrays Are Converted

JSON arrays are converted by repeating the parent key name as the XML element tag for each item. For example, {"colors":["red","blue"]} becomes <colors>red</colors><colors>blue</colors>. When an array contains objects, each object becomes a full XML element with its own child nodes and attributes. Nested arrays are recursively processed to any depth.

Frequently Asked Questions

How does the JSON to XML converter handle JSON arrays?
JSON arrays are converted by repeating the parent key as the element tag name for each item in the array. For example, {"fruits":["apple","banana"]} becomes <fruits>apple</fruits><fruits>banana</fruits>. If the array contains objects, each object becomes a full XML element with child nodes. Nested arrays are handled recursively to any depth.
Is my JSON data sent to a server during conversion?
No. This JSON to XML converter runs 100% in your browser using JavaScript. Your data never leaves your computer. No server requests are made during conversion, so it is completely safe for sensitive or proprietary data. You can even use it offline after the page loads.
Can I customize the root element name and XML declaration?
Yes. You can set a custom root element name (default is 'root') which wraps the entire XML output when the JSON has multiple top-level keys. You can also toggle the XML declaration (<?xml version="1.0"?>), choose between 2-space, 4-space, or tab indentation, and enable or disable pretty printing. The attribute handling option lets you control how @attributes objects and @-prefixed keys are treated in the output.
Keyboard Shortcuts
Ctrl+Enter Convert
Ctrl+Shift+C Copy output
Ctrl+L Clear