JSON to XML

Turn JSON into XML for APIs and feeds that still expect tags.

How JSON to XML works

Convert a JSON object into well-formed XML with nested elements and escaped values. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.

That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.

The mapping rules

Object keys become element names, and values become element text. Arrays become repeated <item> elements, because XML has no native array. Everything is wrapped in a <root> element so the output has exactly one root node, as XML requires.

Ampersands, angle brackets and quotes in the values are escaped, which is the difference between valid XML and a file that fails to parse the moment someone types “R&D”.

JSONXML
{"name":"A"}<name>A</name>
["a","b"]<item>a</item><item>b</item>
{"user":{...}}<user>…</user>
"R&D"<name>R&amp;D</name>

What JSON cannot express in XML terms

Attributes, namespaces, mixed content and CDATA have no equivalent in a JSON object, so the conversion produces elements only. If the target schema needs attributes — an id, a lang — the output will validate against nothing.

Type information is also lost. JSON distinguishes number, string and boolean; XML text does not, so "5" and 5 both become the character 5.

When this is the wrong direction

If the consumer expects a specific XSD, hand-build the document. A generic conversion produces a shape no schema will accept, and fixing it afterwards costs more than writing it once.

For data exchange between your own services, keeping JSON is simpler. XML earns its place when the other side already speaks it — SOAP, RSS, or an older enterprise system.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

How are arrays handled?

Each array element becomes an <item> element.

Are special characters escaped?

Yes, & < > are escaped so the XML stays valid.

Does it support attributes?

No. Only elements and text are generated.

Can I convert XML back?

Yes, the XML to JSON page does the reverse and turns repeated tags into arrays.

Keep going

More files tools