JSON to XML Converter
Turn JSON into clean, well-formed XML for older systems, feeds and data exchanges that do not speak JSON. Pick the root element name, turn keys starting with @ into attributes, and get neatly indented or compact output.
How to Convert JSON to XML
Quick answer: paste your JSON, set the root element name, then download the .xml or copy it.
-
1
Add your JSON
Paste it or open a .json file.
-
2
Name the root
The element that wraps everything.
-
3
Choose options
Attributes, declaration, indentation.
-
4
Download .xml
Or copy it.
What You Get
Why Convert JSON to XML?
Many established systems still exchange data as XML: banking and payment formats, government and tax submissions, supplier catalogues, publishing feeds, office documents and enterprise software. When your data is in JSON, converting it to XML lets you feed those systems without rewriting anything by hand.
How JSON Maps to XML
Each JSON key becomes an element with the same name, and its value becomes the element's content. Objects become nested elements, and arrays become the same element repeated, so "book": [ … ] becomes several <book> elements. Keys starting with @ become attributes of their parent element, so "@id": "b1" becomes id="b1". A key named #text becomes the text content of an element that also has attributes. Null values become empty elements.
Valid Element Names
XML names cannot contain spaces or most symbols, and cannot start with a digit. The converter replaces invalid characters with underscores and adds an underscore in front of names that start with a digit, so the output is always well-formed. Special characters in values, such as & and <, are escaped automatically, as in "Paper & Ink".
Example
The sample catalogue becomes <root><catalog version="2"><book id="b1"><title>The Silent Sea</title>…, with each book as its own element and the IDs as attributes. Set the root name to "export" and the outer element changes to <export>. To read XML back into JSON, use XML to JSON.
Who Converts JSON to XML?
Developers connecting modern apps to older systems, integration teams preparing feeds for partners, e-commerce managers building product feeds, publishers producing XML for distribution, and students learning the differences between data formats. Converting in the browser keeps business data private.
Step by Step
Paste your JSON or open a file. Type the root element name your target system expects; check its documentation if unsure. Keep attributes on if your JSON uses @ keys. Leave the declaration line on for files, and tick minify for compact messages. Download the .xml file or copy it. If the JSON is invalid, a message shows where the problem is.
Good to Know
JSON and XML are not identical: XML has no real numbers or true/false values, so everything becomes text, and the order of elements follows the order of keys in your JSON. A top-level array is written as repeated <item> elements inside the root. To check the JSON first, use the JSON Formatter.
Real-World Scenarios
A supplier asks for your product list as an XML file, but your shop exports JSON. Paste the export, set the root name to "products", and each product becomes a <product> element with its fields inside. Another common case is a payment or accounting system that only accepts XML messages: build the message in JSON, where it is easier to write, then convert it here and paste the XML into the request. Teachers also use the converter to show students how the same data looks in both formats side by side, which makes the differences in structure and syntax easy to explain.
Private, Free and Instant
The converter is free and works with files up to 5 MB. There is no sign-up, no row limit beyond the 5 MB file size and nothing to install. The conversion runs in your browser, so customer lists, exports, settings files and other private data are never uploaded or stored. You can open a file from your device, paste data straight from another program, and download the result with the right file extension. It works on Windows, Mac, Linux, Chromebooks, iPhone and Android.
JSON to XML: Building Markup From Data
Some older systems and enterprise interfaces still require XML. Converting JSON produces elements for each key.
Mapping rules
Object keys become element names, arrays repeat the element, and values become text. Keys that are not valid XML names, such as those starting with digits or containing spaces, must be changed.
Always check the result against the schema the receiving system expects. For the opposite direction, use XML to JSON.
Frequently Asked Questions
Questions about JSON to XML