Skip to content

JSON to XML

Turn a JSON file into indented, well-formed XML. Nothing is uploaded.

On your device

Drop JSON files here

Converted on your device. Files are never uploaded.

Up to 20 files at a time.

Some systems, from older enterprise software to config loaders and feeds, still take only XML. FormatJet writes your JSON out as indented XML with a declaration, choosing a root element, turning list entries into item elements and fixing key names XML can’t use. It runs in your browser, so your data never leaves your device.

About the formats

JSONJSON file

JSON is the text format web APIs and apps use to exchange data: objects, lists, text, numbers and true or false values, nested as deep as needed.

XMLXML file

XML stores data as nested, named elements with attributes. Feeds, office files, invoices and older web services use it.

Converted with Data converters (Papa Parse, yaml, fast-xml-parser), Data converters on Workers.

Questions

What becomes the root element?

If your JSON is an object with a single key, that key becomes the root element. Anything else is wrapped in a <root> element.

How is a JSON array written in XML?

When the JSON is a list, it’s wrapped in <root> and each entry of the list becomes an <item> element.

What if a key isn’t a valid XML name?

It’s fixed rather than refused. Spaces and other characters XML doesn’t allow in names become underscores, and a key that starts with a digit gets an underscore in front, so "2024 total" becomes _2024_total. Two keys that end up with the same name both stay, the second as _2.

What does the XML file look like?

It opens with an XML declaration, is encoded as UTF-8 and is indented, so nested elements are easy to follow.

Can I convert several JSON files together?

Yes, up to 20 at a time. Each becomes its own XML file under the same name, and you can download them one by one or as a ZIP.

JSON to XML with the API

The conversion API opens later this year.

curl https://api.formatjet.com/v1/convert?to=xml \
  -H "Authorization: Bearer fj_test_…" \
  -F file=@input.json -o output.xml