How to Convert JSON to XML
Plenty of enterprise systems, SOAP services and legacy integrations still speak XML, while your data arrives as JSON. This converter bridges them faithfully. It parses your JSON and walks the whole structure, turning objects into elements and nested objects into nested elements at any depth — nothing is flattened or lost. Array values become repeated tags, which is the idiomatic way XML expresses a list. You name the wrapping root element and the tag used for each item in a top-level array, and keys that aren't valid XML names are sanitised into legal element names. Ampersands and angle brackets in values are escaped so the result is always well-formed, and null or empty values become clean self-closing tags. Toggle the XML declaration on for standalone files or off when embedding, then copy or download. Everything runs in your browser, so nothing is uploaded.
Paste your JSON
Paste any valid JSON or load the sample; it's parsed locally with nothing uploaded.
Set the options
Name the root and item tags and toggle the XML declaration.
Copy or download
Grab the XML with one tap or save it as a .xml file.
JSON vs XML — What's the Difference?
JSON — JavaScript Object Notation
A compact format of objects and arrays with real types, ideal for modern APIs and code. It's lighter than XML but not what older systems expect.
XML — Extensible Markup Language
A verbose, tag-based, self-describing format used widely in enterprise tooling, SOAP and document exchange. Converting JSON to XML makes your data speak that world.
Common Use Cases
Feed XML systems
Turn a JSON payload into the XML an older system or API expects.
SOAP services
Prepare XML request or response bodies from JSON data.
Config & feeds
Produce XML configuration or data feeds from JSON.
Match a schema
Use custom root and item tags to fit an existing XML structure.
Data exchange
Convert JSON records into XML for a partner integration.
Legacy migrations
Move JSON data into XML-based systems and pipelines.
Document formats
Generate XML fragments for document-based formats.
Quick transforms
A fast, no-install way to turn JSON into XML.
Tips & Best Practices
Start from valid JSON
The input must parse as JSON, so fix trailing commas or unquoted keys first.
Name tags for your schema
Set the root and item tags to match the XML structure the target system expects.
Use simple key names
Keys that are valid XML names avoid sanitising and produce the cleanest tags.
Arrays become repeats
A JSON array turns into repeated elements — the standard XML way to express a list.
Keep the declaration for files
Leave the declaration on for standalone .xml files; turn it off when embedding.
Trust the escaping
Values with & or < are escaped automatically, so paste as-is without cleaning.
Troubleshooting
It says the JSON is invalid
The input must be valid JSON. Check for trailing commas, single quotes or unquoted keys, then try again.
A tag name looks changed
Keys that aren't valid XML names — with spaces or a leading digit — are sanitised into legal element names automatically.
Arrays produced repeated tags
That's intentional and idiomatic: each array element becomes its own element with the same tag name.
Special characters look odd
Characters like & and < are shown as their XML entities (&, <) — that's correct, well-formed XML.
Frequently Asked Questions
How do I convert JSON to XML for free?
Paste your JSON above and well-formed XML appears instantly. Copy it or download a .xml file — free, no signup.
Does it keep nested structure?
Yes. Nested objects and arrays become nested XML elements at any depth, so nothing is lost.
Can I name the tags?
Yes. Set the wrapping root element and the tag used for each item in a top-level array.
How are arrays handled?
Each array element becomes a repeated element with the same tag — the idiomatic XML way to express a list.
Is the XML well-formed?
Yes. Ampersands and angle brackets are escaped and tag names are sanitised, so the output is valid XML.
What happens to invalid key names?
Keys that aren't legal XML names — with spaces or a leading digit — are sanitised into valid element names.
Can I omit the XML declaration?
Yes. Turn off the declaration to embed the XML in another document, or leave it on for standalone files.
What about null and empty values?
Null and empty values become clean self-closing elements.
Does it work with a single object?
Yes. A single object's keys become elements directly under the root.
Does it add attributes?
No. This converter maps values to child elements for clarity; use our CSV to XML tool if you prefer attributes.
Is my data sent to a server?
No. Everything happens inside your browser, so your data never leaves your device.
Can I download the result?
Yes. Save the output as a .xml file, or copy it straight to your clipboard.
How large a file can it handle?
It comfortably converts large JSON documents, all within your browser.
Can I convert XML back to JSON?
Yes — use our XML to JSON converter for the reverse direction.
Does it preserve Unicode?
Yes. Any Unicode characters in your data are preserved in the XML output.
Does it show errors?
Yes. If the JSON is invalid, you get a clear message pointing you to the problem.
Does it work on phones?
Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.
Is this converter really free?
Completely free, forever — no account, no ads and no premium wall.
100% free · No signup · Processed in your browser · Data never sent
Last updated: August 2026 · FlipMyFormat JSON to XML Converter
Written and maintained by the FlipMyFormat team · Runs entirely in your browser