JSON to XML Converter

Data Conversion

Transform JSON into well-formed XML, with attributes and sensible element names.

Runs entirely in your browser — nothing is uploaded

Features

  • Keys beginning @ become attributes; #text becomes element text.
  • Arrays become repeated elements, named by singularising the parent.
  • Invalid element names are corrected and every rename is listed.
  • Configurable root element, indentation and XML declaration.
  • Round-trips with the XML to JSON tool.

How to use the JSON to XML Converter

  1. 1Paste your JSON, or drop a .json file.
  2. 2Set the root element name and the indentation.
  3. 3Copy the XML or download it.

Frequently asked questions

How do JSON arrays become XML?

XML has no arrays, so a list becomes a repeated element. A "tags" array produces a <tags> parent holding one <tag> per entry — the item name is derived by singularising the parent, which reads far better than a generic <item>. You can set a fixed name instead.

Can I produce attributes rather than child elements?

Yes. Any key starting with @ becomes an attribute, so {"@id": "bk101"} produces id="bk101" on the element. This is the same convention the XML to JSON tool uses, so documents round-trip between the two.

What happens to keys that are not valid XML names?

XML names cannot contain spaces, cannot start with a digit and cannot begin with “xml”. Any such key is rewritten — “first name” becomes first_name — and every rename is listed above the output, because an element renamed silently is a document broken silently.

How is null represented?

As an empty element, <field/>. Turn on the nil option to write <field nil="true"/> instead, which is what some XML schemas and .NET services expect.