JSON

JSON to XML Converter

Converts JSON into well-formed XML, with control over the root and repeated element names.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the JSON document.
  2. Name the root element, and the element that repeated array entries should use.
  3. Select Convert to XML and copy the result.

What json to xml does

JSON and XML do not map onto each other cleanly. JSON has one anonymous root value; XML requires a single named root element. JSON arrays have no name of their own; XML expresses a list as repeated sibling elements, which must be named. This converter asks you for both names rather than guessing.

Keys that are not valid XML element names — ones starting with a digit, or containing spaces or colons — are escaped rather than silently dropped, so the output is always well formed. If you need attributes rather than child elements, that is a schema decision no converter can make for you, and the output here is elements throughout.

Frequently asked questions

XML requires exactly one named root element, and JSON has an anonymous root value. There is no correct default, so the converter asks rather than inventing one.

Child elements throughout. Whether a value belongs in an attribute is a schema design decision that depends on your XSD, and a converter cannot infer it from JSON.

Keys starting with a digit or containing spaces or other illegal characters are escaped into a valid name, so the output is always well formed. The original key is preserved as an attribute on the element.