Skip to content
Utilerio

JSON to XML

Turn JSON into well-formed XML with a root element you choose.

XML output

The result will appear here.

Was this tool useful?

About this tool

Plenty of systems still speak XML: SOAP services, e-invoicing formats, EDI gateways, older ERP integrations. When the data you have is JSON and the endpoint wants XML, the conversion itself is mechanical — the decisions are about naming.

XML needs exactly one root element, and JSON arrays have no element name to give their items. This tool asks you for both up front rather than inventing names, so the output matches the schema the receiving system expects.

How to use it

  1. Paste your JSON.
  2. Name the root element. It must start with a letter or underscore and contain no spaces.
  3. Name the element used for array items — the tag that wraps each entry in a list.
  4. Choose whether to include the <?xml … ?> declaration and set the indentation.
  5. Convert, then copy or download the XML.

Examples

An object with a nested array

{ "id": 1001, "items": ["TL-001", "TL-002"] }
<?xml version="1.0" encoding="UTF-8"?>
<order>
  <id>1001</id>
  <items>TL-001</items>
  <items>TL-002</items>
</order>

Common problems

The root name is rejected.
XML names cannot start with a digit or contain spaces. Use order rather than 1001 or my order.
Keys with special characters produce broken XML.
A JSON key can be any string; an XML element name cannot. Rename keys containing spaces, slashes or leading digits before converting.
The receiving system wants attributes, not elements.
Attributes are not inferable from plain JSON. Produce them by adopting the @_ convention used by the XML to JSON tool, so a key named @_id becomes an attribute.

Frequently asked questions