JSON to XML

Converts JSON into XML, for integrating with older systems that only accept XML.

Convert JSON data to XML format.

Steps and notes

What is JSON to XML?

XML is still the interchange format for a lot of enterprise, payment and SOAP-style systems, even though JSON won. This tool maps a JSON value onto an XML document: objects become elements with a child element per key, arrays become repeated elements sharing the same tag name, and scalar values become text content. Because XML and JSON model data differently — XML has no native array or boolean type — the conversion makes a set of reasonable choices (booleans and numbers become string text, for instance), and the XML-to-JSON tool reverses it when you receive XML back.

  1. Paste the JSON
  2. Get the XML result
  3. Copy and use it
  • XML has no concept of arrays, so lists become repeated tags

Frequently asked questions

How are arrays represented in XML?
An array of values becomes several sibling elements that share the same tag name. [1, 2, 3] under the key "item" becomes <item>1</item><item>2</item><item>3</item>. There is no XML array type, so the repeated-tag convention is the standard way to round-trip a list.
What happens to the root element?
XML documents need exactly one root element, but top-level JSON may be an object, array or scalar. This tool wraps the output in a root element (commonly <root>) so the result is always well-formed XML; rename it to match the schema your consumer expects.
Is the conversion reversible?
With caveats. Converting XML back to JSON again loses the distinction XML never had — there is no native boolean or number, everything is text — so 1 may come back as the string "1". Keep the original JSON if you need exact types round-tripped.

Read the full step-by-step guide for this tool

Category: Converter

JSON format conversion workflow

JSON to YAML converter → YAML to JSON converter → JSON to XML → XML to JSON → JSON to TOML → TOML to JSON