JSON to XML Converter

Keys become elements, arrays become repeated elements.

This tool converts JSON into indented XML for systems that still speak XML: SOAP services, RSS and sitemap feeds, enterprise integrations and legacy configuration files. Object keys become element names and arrays become repeated elements with the same name.

To produce XML attributes, prefix a key with @_. For example {"item": {"@_id": 7}} becomes <item id="7"/>.

How to use it

  1. Paste a JSON object into the left editor.
  2. Review the XML on the right.
  3. Copy or download the XML document.

Questions

Why is my output wrapped in a root element?

XML requires exactly one root element. If your JSON is an array, a primitive or an object with more than one top-level key, it is wrapped in a <root> element to keep the document well formed.

How do I create attributes?

Use keys that start with @_. They are written as attributes on the parent element instead of child elements.

Are all JSON keys valid XML element names?

No. XML names cannot start with a digit or contain spaces. Rename such keys before converting.

All tools