Back to Tools

JSON to XML Converter

Turn JSON into XML for systems that only accept XML, or switch direction to turn XML into JSON.

JSON Input

Paste JSON, or load the sample

XML Output

The XML version of your JSON

Convert your JSON to see the XML output

How to use it

Use the switch button at the top to change direction.

1

Paste your data

Paste the JSON you want to convert into the input box.

2

Convert

Click Convert to XML. Turn off Pretty Print first if you want everything on one line.

3

Download or copy

Download the result as a file or copy it to your clipboard.

Features

How the two formats are mapped.

Both directions

The same page converts JSON to XML and XML to JSON.

Pretty print

On by default, it indents the output. Turn it off for compact output on a single line.

Nested data and types

Nested objects become nested elements, and special characters such as < and & are escaped. Going the other way, XML text that looks like a number, true or false becomes a JSON number or boolean, and attributes become keys starting with @.

Download or copy

Save the result as a file or copy it to your clipboard.

FAQ

Common questions about converting between JSON and XML.

What are the differences between JSON and XML?

JSON is shorter and maps directly to JavaScript objects. XML is more verbose but has attributes, namespaces and mature schema tools, and many older systems and document formats still use it.

How are arrays handled in the conversion?

From JSON to XML, an array becomes an element named after its key, with each entry inside an <item> element. From XML to JSON, sibling elements with the same name become an array.

Is my data secure?

Yes. The conversion runs in your browser. Your data is not sent to a server or stored.

When would I need to convert between JSON and XML?

Usually when one system speaks JSON and the other expects XML, for example sending data from a modern API to an older SOAP service or importing an XML export into a JavaScript app.

Other JSON tools

Convert JSON to a table or CSV, format it, compare two files, or query it with JSONPath.

View All Tools