JSON to XML Converter
Convert JSON to XML online, free and instantly. Runs entirely in your browser — nothing is uploaded, and there is no file size limit.
Input
Output
Ready
Drop a file to load it
About this tool
Convert JSON into XML in a single step. JSON is the default interchange format for web APIs; XML is the markup format behind SOAP, RSS, sitemaps and countless enterprise feeds. The converter is structure-aware rather than a text substitution, so nesting, types and ordering are preserved.
When you would use it
- Feeding JSON data to a service that only accepts XML
- Migrating a dataset from JSON to XML
- Inspecting JSON in a shape that is easier to read
Worked example
{
"id": 4815,
"name": "Ada Lovelace",
"active": true,
"score": 91.5,
"roles": ["admin", "editor"],
"address": { "city": "London", "postcode": "NW1" }
}
<?xml version="1.0" encoding="UTF-8"?>
<root>
<id>4815</id>
<name>Ada Lovelace</name>
<active>true</active>
<score>91.5</score>
<roles>admin</roles>
<roles>editor</roles>
<address>
<city>London</city>
<postcode>NW1</postcode>
</address>
</root>
Things worth knowing
- Keys beginning with
@become attributes; everything else becomes an element. - Arrays repeat the element rather than creating a wrapper, which is the convention most XML consumers expect.
- Keys that are not valid XML names are sanitised, since XML element names cannot contain spaces or start with a digit.
Questions
Frequently asked
Is JSON to XML conversion lossless?
Yes for structure and values. Converting back gives you an equivalent document.
Why convert JSON to XML?
JSON is the default interchange format for web APIs, while XML is the markup format behind SOAP, RSS, sitemaps and countless enterprise feeds. Converting is usually about handing data to a tool that only speaks one of them — a legacy service or SOAP endpoint, for instance.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Related