Skip to tools

Converters

JSON to XML

Many legacy systems, SOAP services and enterprise integrations still require XML while modern APIs speak JSON. The JSON to XML converter maps each JSON key to an element and nests objects as child elements, producing well-formed, indented XML.

Arrays become repeated elements with the same name, which is the conventional way to represent lists in XML.

How to use the JSON to XML

  1. 1Use the JSON to XML right on this page, or open the full workspace for history, sharing and every other tool.
  2. 2Paste your input, upload a file, or drag and drop a file onto the input box (up to 25 MB).
  3. 3The result appears in the output panel automatically and updates when you change the input or an option.
  4. 4Use Copy Output or Download to save the result. Nothing is uploaded to a server.

Example

A JSON user object becomes a <user> element with child elements for each field.

Input
{"user":{"name":"Ada","age":36}}
Output
<user>
  <name>Ada</name>
  <age>36</age>
</user>

When to use it

  • Sending data from a JSON API to a system that only accepts XML
  • Generating XML test fixtures from existing JSON samples
  • Migrating configuration between JSON-based and XML-based tools

Tips and common mistakes

  • Wrap your data in a single top-level key so the XML has one root element.
  • Keys that start with a number or contain spaces are not valid XML element names.
  • Use XML to JSON to check the conversion round-trips as expected.

Frequently asked questions

How are arrays converted?

Each array item becomes a repeated element using the parent key as its name.

Can I create XML attributes?

Keys prefixed with @_ are treated as attributes, matching the format produced by our XML to JSON tool.

TutorialXML explained: still relevant, still everywhere

Related tools

Ready to try it?

Free, no sign-up, and your data never leaves your browser.