Free Developer Tool

JSON to XML Converter: Convert JSON to Well-Formed XML

Paste a JSON object or string and turn it into structured XML instantly. Keys become tags and nested objects become child elements.

JSON to XML Objects and arrays Nested elements Readable output SOAP ready Built-in sample No signup

Translate JSON to XML for Systems That Still Need It

JSON won the API war, but XML never went away. SOAP services, RSS feeds, sitemaps, banking integrations and plenty of enterprise software still expect XML. When your data starts life as JSON, this JSON to XML converter handles the translation, so you can send the right format without hand-writing a single tag.

Read more

How JSON to XML Conversion Works

Each JSON key becomes an XML tag, and its value becomes the content of that tag. Nested objects turn into child elements, and arrays become repeated elements that share the same name.

Convert JSON Object to XML in One Step

Got a JSON object from an API response? Paste it in and turn it into XML in one step. The hierarchy stays exactly as it was, just written with tags instead of curly braces.

Convert JSON String to XML, or a Whole File

Whether you copied a JSON string from your logs or opened a .json file in a text editor, the process is the same: paste, convert, copy. It's the quickest way to convert a JSON file to XML without writing a script.

An Online JSON to XML Converter for Any Device

There's nothing to download. This JSON to XML converter online runs in your browser on desktop or mobile, which makes it handy for quick checks in the middle of integration work.

Built for SOAP, Feeds and Legacy Systems

Payment gateways, shipping carriers and government portals often accept only XML. Transform JSON to XML here to test your payload before you wire up the real integration.

Remember the One-Root Rule

A valid XML document has exactly one root element. If your JSON has several top-level keys, wrap them in a single parent key, such as "order", so the XML stays well-formed and your target system accepts it.

How to Convert JSON to XML

1

Paste your JSON

Paste a JSON object, array or string into the input box. Click Sample to see an example.
2

Click Convert

The JSON to XML converter maps every key to a tag and every nested object to a child element.
3

Review the XML

Check tag names and nesting. XML tag names can't contain spaces or start with a number, so rename any keys that do.
4

Copy and send

Copy the XML into your SOAP request, feed or config file. Click Reset to start again.

JSON to XML FAQs

Converting JSON to XML, explained.

How do I convert JSON to XML online?

Paste your JSON into the box above and click Convert. The tool returns XML right away. It's a free JSON to XML online conversion with no account and nothing to install.

What does JSON to XML look like?

Here's a quick example. This JSON: { "order": { "id": 1024, "item": "Desk lamp", "qty": 2 } } becomes this XML: <order> <id>1024</id> <item>Desk lamp</item> <qty>2</qty> </order>

How are JSON arrays converted to XML?

Arrays become repeated elements. For example, { "color": ["red", "blue"] } turns into two <color> elements, one for each value. Some systems expect a wrapper tag around the list, so check what your target format requires.

How do I handle JavaScript JSON to XML conversion?

JavaScript has no built-in JSON to XML function, so most JSON to XML JavaScript code relies on a library. Need JSON to XML JS code for Node.js? The fast-xml-parser package includes an XMLBuilder: const { XMLBuilder } = require("fast-xml-parser"); const xml = new XMLBuilder().build(jsonObject);

How do I convert JSON to XML in Python?

The xmltodict library can write XML as well as read it: import json, xmltodict data = json.loads(json_string) xml = xmltodict.unparse(data, pretty=True) Your dictionary needs a single root key for this to work.

How do I convert JSON to XML in Power Automate?

Power Automate has an xml() expression for this. Pass it your JSON, for example xml(json(body('HTTP'))), and it returns XML. The JSON must have one root property, so wrap your data in a single key first.

Do data types survive JSON to XML conversion?

When you convert from JSON to XML, the data carries over, but types don't. XML stores everything as text, so 42 and "42" look the same once converted. If the receiving system cares about types, it should define them with an XML schema (XSD).

Which JSON keys don't work as XML tags?

Keys with spaces, keys that start with a number and keys with characters like @, # or / aren't valid XML tag names. Rename them before converting (for example, "first name" to firstName and "2024" to y2024), or an XML parser may reject the output.

Why do some systems still use XML instead of JSON?

XML supports schemas, namespaces, attributes and digital signatures, which matter a lot in finance, healthcare and government. Many of those systems were built before JSON took off, and replacing them is expensive, so XML is still part of daily integration work.

Is this JSON to XML converter free?

Yes. It's free, needs no signup and works on any device with a browser.

Need to go the other way?

Turn XML back into JSON with our XML to JSON converter.

Open XML to JSON

Raheel Jakhura

CEO / Co-Founder

Our goal is to provide online free tools so you don't have to install any software for basic usages. We are trying to add more tools and make these tools free forever.

cookies image
Verilerinizi önemsiyoruz ve deneyiminizi geliştirmek için çerezleri kullanmayı çok isteriz.