Home / Convert / JSON to XML Converter
↔️ JSON to XML Converter
JSON to XML Converter – get instant, free results right on your device.
Keys starting with “@name” become attributes and “#text” becomes text content; arrays turn into repeated tags. Keys containing invalid characters are fixed with “_”. Not an official institution.
Last updated: November 2026 · Parameter year: 2026 · Methods and sources: Methodology · Editorial policy
What is JSON to XML Converter?
The need for conversion arises when you need to send JSON data to a system that expects XML, or save a document in XML format. Because the two formats use different data models (attributes, text nodes, repeated tags), the conversion rules must be clear.
The tool turns each key in the JSON object into a tag. Keys starting with “@” become attributes, and the “#text” key becomes the text content; arrays turn into repeated tags with the same name. If the JSON has a single root key, that becomes the root tag; otherwise, the “root tag name” you enter is used. For example, the input {"a":{"b":1}} gives <a><b>1</b></a>, and the output starts with an XML declaration.
Characters that are invalid in XML tag names are replaced with “_”; keys that start with a digit get “_” added at the start. Numbers and boolean values in JSON are written as text in XML. The input is not sent to a server; it is processed in the browser. To make the output readable or to validate it, you can use the XML Formatter tool.
How to use
Fill in these fields: Root tag name, JSON. Then press the button; the result appears on the same page and your data never leaves your device.
Formula
{"a":{"b":1}} → <a><b>1</b></a>
Example
{"a":{"b":1}} → <a><b>1</b></a>
Worked examples and tips
Example 1: The input {"kitap":{"@id":"1","baslik":"Suç ve Ceza","etiket":["roman","klasik"]}} is converted to a <kitap id="1"> element. The @id key becomes an attribute, baslik becomes a child element, and the etiket array is written as two separate <etiket> lines. An XML declaration line is also added at the top.
Example 2: For a JSON array with no root, [{"ad":"Ali","yas":30},{"ad":"Ayşe","yas":28}], if you enter kisiler as the root tag name, the tool produces a separate <kisiler> block for each record; each block contains ad and yas elements. Because this output contains two roots, it does not count as a single-piece XML document; add an outer wrapper if needed.
Example 3: The input {"urun":"Çay & Şeker","fiyat":12.5} has no single root, so the default root, kayitlar, is used. In the result you see <urun>Çay & Şeker</urun> and <fiyat>12.5</fiyat>; the & sign has been escaped automatically.
Tips and common mistakes: Because key names become tag names, names containing spaces or starting with a digit produce invalid XML. If you want attributes, remember to put @ at the start of the key. Every item inside an array repeats with the same tag; this can be a problem for the target system. If you really want a single object as the root, wrap the JSON in a top-level key.
When is it used? When transferring data from a system that produces JSON to a system that expects XML.
Frequently asked questions
JSON to XML Converter – how to use it?
Fill in the fields and press the button; the result appears instantly. Example: {"a":{"b":1}} → <a><b>1</b></a>
JSON to XML Converter – is it free, and is my data stored?
Yes, it is free and requires no sign-up. Because processing happens in your browser, the information you enter is not sent to a server.
Related guide
- What Is XML? The Difference Between XML and JSON, and How to Convert – What is XML, and what are its syntax rules? Differences between XML and JSON, how to choose between them, and examples of converting XML to JSON.