JSON to XML

Convert JSON to XML format. Recursively traverses JSON to generate XML strings with a customizable root element — all in your browser, no upload, instant results.

About the JSON to XML Converter

This JSON to XML converter runs entirely in your browser. Paste JSON into the box above, optionally set a root element name, and click Convert. The result appears as formatted XML. Nothing is uploaded to a server — the conversion happens instantly with JavaScript on your device.

About the XML format

XML (eXtensible Markup Language) is a markup language that defines a set of rules for encoding documents. It uses tags to delimit data, supports attributes on elements, and can be nested arbitrarily. It is widely used for configuration, data exchange (SOAP, RSS), and document storage.

Conversion rules

  • Root element — The top-level JSON object is wrapped in a single root element whose name you can customize.
  • Objects — Each object property becomes a child element named after the key.
  • Arrays — Each array item becomes a child element using the same key name as the array itself.
  • Scalars — Strings, numbers, and booleans become the text content of their element.
  • Null — Null values produce an empty self-closing element.
  • Special keys — A @attributes object generates element attributes; a #text key sets text content alongside attributes.
  • Escaping — Text and attribute values are XML-escaped (& < > " ').

Common use cases

  • Producing XML payloads for legacy SOAP services.
  • Generating XML configuration files from JSON data.
  • Exporting JSON data to XML-based publishing pipelines.
  • Quick inspection of JSON structures in XML form.

Frequently asked questions

Does this tool upload my JSON? No. All conversion happens locally in your browser. Your data never leaves your device.

What root element should I use? Any valid XML name works. The default is root, but you can use a name meaningful to your application, like response or data.

How are arrays handled? Each item in a JSON array becomes a sibling element using the array's key as the tag name, matching the typical XML representation of repeated elements.

Is there a size limit? The only limit is your browser's available memory. Even large JSON files convert quickly.