Paste a JSON array into the Quick paste box. The tool flattens it into a table and writes XML with one tag per column. It only handles tabular data and does not rebuild a nested tree.
Runs entirely in your browser. Your data is never uploaded. Tiếng Việt
You reach for JSON to XML when a legacy system, a SOAP-style endpoint or an import step accepts only XML. JSON can nest many levels deep, while this tool works with rows and columns only. With Flatten nested objects (a.b.c) switched on, nested objects become columns named a.b.c and arrays become a.0, a.1. Each column then turns into one flat XML tag, so the nesting of the original JSON is gone.
Quick paste box and press Load into table ↵, or use Import file with a .json file. This page already has flattening switched on.⚙ Options. Set the root tag and the row tag, and turn on the header-as-tag option if you want tags named after the columns.Copy result or Download file to get the .xml file.Tag names such as customer.name and order.items.0 are the paths from the source JSON, no longer nested. Order A2 has a single item, so its order.items.1 and order.items.2 tags are empty.
[
{
"id": "A1",
"customer": {
"name": "Anna Reed",
"city": "London"
},
"order": {
"total": 450,
"items": [
"book",
"pen"
]
}
},
{
"id": "A2",
"customer": {
"name": "Ben Cole",
"city": "Leeds"
},
"order": {
"total": 1250,
"items": [
"backpack"
]
}
},
{
"id": "A3",
"customer": {
"name": "Cara Lin",
"city": "Bristol"
},
"order": {
"total": 299.5,
"items": [
"notebook",
"pen",
"ruler"
]
}
}
]<?xml version="1.0" encoding="UTF-8"?>
<orders>
<order><id>A1</id><customer.name>Anna Reed</customer.name><customer.city>London</customer.city><order.total>450</order.total><order.items.0>book</order.items.0><order.items.1>pen</order.items.1><order.items.2></order.items.2></order>
<order><id>A2</id><customer.name>Ben Cole</customer.name><customer.city>Leeds</customer.city><order.total>1250</order.total><order.items.0>backpack</order.items.0><order.items.1></order.items.1><order.items.2></order.items.2></order>
<order><id>A3</id><customer.name>Cara Lin</customer.name><customer.city>Bristol</customer.city><order.total>299.5</order.total><order.items.0>notebook</order.items.0><order.items.1>pen</order.items.1><order.items.2>ruler</order.items.2></order>
</orders>cell tag and keeps the header as a row.order.items.2 for order A2. Check that the receiver accepts empty elements.A & B remains valid XML.No. It is flattened into a.b.c columns and written as sibling tags. To keep a tree you need to edit the XML afterwards.
Each element becomes its own column numbered from 0, such as order.items.0 and order.items.1, and the XML tags carry those names.
Yes. Toggle <?xml?> declaration in the XML tab options.
The nested part stays in one cell as JSON text and is escaped in the XML. Nothing is lost, but it is awkward to use.
No. Reading the JSON and building the XML both happen in your browser.