Developer tools

JSON to XML Converter (and XML to JSON)

Free, no sign-up, works in your browser. Convert JSON to well-formed XML, or XML to JSON, with attributes, repeated elements and text kept intact. Errors point to the line that needs fixing.

Direction
Indent

Attributes appear as keys starting with @, repeated elements become lists, and text next to child elements goes in #text. The same keys work in the other direction.

Your data stays on your device.

How to use the JSON to XML Converter

  1. Choose JSON to XML or XML to JSON.
  2. Paste your data or open a file.
  3. Copy or download the result.

Frequently asked questions

How are XML attributes shown in JSON?
As keys starting with @, so <book id="1"> becomes {"book": {"@id": 1}}. Use the same keys in JSON to create attributes in XML.
What happens to repeated elements?
Elements with the same name become a JSON list. A JSON list turns back into repeated elements.
What if a JSON key isn't a valid XML name?
Characters XML doesn't allow are replaced with underscores, and names that start with a digit get a leading underscore.
Are comments and CDATA supported?
CDATA content is kept as text. Comments, the XML declaration and DOCTYPE are skipped, since JSON has no place for them.
Is my data uploaded?
No. Conversion happens on your device.
Is the JSON to XML Converter free?
Yes. It's free to use, with no sign-up and nothing to install.