Sign in Sign up free Account

JSON to XML Converter

Turn JSON into well-formed XML: @keys become attributes, lists repeated elements, and keys that are not valid XML names are fixed and listed.

How it works

  1. Paste or drop your JSON

    Paste JSON into the box or drop a file. It is read in your browser; the format is detected if you are not sure which it is.

  2. Check the XML

    The XML appears beside it as you type. A mistake in the input is pointed out by line and column instead of producing half a file.

  3. Copy or download

    Copy the XML or download it as a .xml file. Swap turns it straight back.

JSON to XML Converter: what you need to know

Most people who convert JSON to XML want one thing: your data in the new format, exactly as it was. Not every converter delivers it; plenty mangle leading zeros, split cells at commas inside quotes, or upload your spreadsheet to a server. Here is what this one does differently, and how to get the best XML out of your JSON.

Searching for JSON array to XML lands you here too. The steps are short: drop your JSON into the box above, check the result, and download an XML when it looks right.

JSON and XML: what changes

  • JSON: Structured data as nested objects and lists, the language of web APIs. Nested data does not fit a flat table without decisions about how to flatten it.
  • XML: Structured data in tags, with attributes and nesting. Strict, validated and still used across finance, publishing and government.

How the JSON to XML converter works

A JSON is read in your browser. Quoted commas, line breaks inside cells, leading zeros and long ID numbers come through untouched, and values like 1,234.50, $1,200 and 7% are recognised as numbers.

It is written as XML, and a preview of the first rows is shown before you download.

What the XML is used for

  • Feeds and sitemaps
  • Business data exchange
  • Office files inside

What makes this JSON to XML converter different

  • Numbers stay numbers. Currency and percentages are recognised.
  • Preview first. See the rows before you save.
  • Private by design. Bank statements and customer lists never leave your computer.

Tips for the best XML

  • Make sure the first row holds the column names.
  • Remove totals rows and notes above the table for the cleanest result.

On the blog: How to Convert JSON to XML Free, Step by Step

JSON to XML converter

  • json to xml
  • json to xml converter
  • convert json to xml
  • json to xml online
  • json array to xml

JSON to XML that always gives well-formed XML: keys that are not valid element names (spaces, a leading digit) are fixed and listed. This JSON to XML converter writes @keys as attributes and #text as element text.

To convert JSON to XML, paste it or open the file and download. JSON array to XML: each entry becomes a repeated element, and a list at the top is wrapped in a root you can name. JSON to XML online, nothing uploaded.

People also search for

  • xml to json
  • json to yaml
  • json to csv

Why it matters

Round-trips cleanly

XML attributes become @keys, text next to them #text and repeated elements lists, and they go back to the same XML: the conventions xml2js and xmltodict use.

Types where they are clear

Plain numbers and true/false become JSON numbers and booleans. Leading zeros, long IDs and phone numbers stay text, so nothing is quietly changed.

Nothing uploaded

Config files, API responses and exports with keys in them stay on your computer: the conversion runs in this tab.

Reviews

No reviews yet. Used this tool? Yours could be the first.

Used this tool? Sign in to write a review.

Questions

What is the best JSON to XML converter?

One that gives you your data in the new format, exactly as it was, shows the result before you pay, and does not upload your file. That is what this page is built to do.

How are XML attributes shown in JSON?

As keys that start with @: <book id="7"> becomes {"book": {"@id": 7}}. Text beside attributes or child elements goes under #text. The prefix can be changed or removed.

What happens to repeated XML elements?

Two or more elements with the same name become a JSON list. A single one stays an object, which is how most XML-to-JSON converters behave; check the shape if your code expects a list every time.

Are XML comments kept?

No. JSON and YAML have nowhere to put them, so they are left out and the page says how many.

What about text mixed in between elements?

Text that sits between child elements, as in a paragraph with <b>bold</b> words in it, is joined into one #text value. That suits data files; for documents such as XHTML, keep the XML.

Which YAML is supported?

YAML 1.2, read by the eemeli/yaml library, which is checked against the official yaml-test-suite: anchors and aliases, << merge keys, multi-line strings, custom tags, and several documents separated by ---, which become a list.

Is there a size limit?

Files up to 50 MB. Very large files take a few seconds, since everything runs in your browser.