Home / Convert / XML to JSON Converter
🔀 XML to JSON Converter
XML to JSON Converter – get instant, free results right on your device.
Attributes are shown with the “@name” key and text content with the “#text” key; repeated tags become arrays. All values remain text; no number or boolean conversion is done. Not an official institution.
Last updated: November 2026 · Parameter year: 2026 · Methods and sources: Methodology · Editorial policy
What is XML to JSON Converter?
XML and JSON are the two most commonly used formats for data exchange. Legacy systems, SOAP services, and configuration files use XML, while modern APIs mostly work with JSON. When moving data between these two worlds, you need to convert XML to JSON, and the conversion rules should be known up front.
The tool makes the root tag of the XML the outermost key of the JSON. Attributes are shown with an “@name” key, and the text content of a tag is shown with a “#text” key if it also has other child elements. Repeated tags with the same name become an array. For example, for the input <kitap id="1"><etiket>roman</etiket><etiket>klasik</etiket></kitap>, you get “@id” and an array for etiket.
All values remain text; “30” is not converted to a number and “true” is not converted to a boolean. A tag with a single element comes out as an object rather than an array, so for data where the same tag appears once or many times, you must handle both cases in your code. The input is processed in your browser and is not sent to a server. For the reverse conversion, see the JSON to XML Converter tool.
How to use
Fill in these fields: XML. Then press the button; the result appears on the same page and your data never leaves your device.
Formula
<a x="1">t</a> → {"a":{"@x":"1","#text":"t"}}
Example
<a x="1">t</a> → {"a":{"@x":"1","#text":"t"}}
Worked examples and tips
Example 1: When you convert the XML <kitap id="1"><baslik>Suç ve Ceza</baslik><etiket>roman</etiket><etiket>klasik</etiket></kitap>, a kitap object is created in the JSON. The id attribute is written as "@id": "1", baslik becomes plain text, and the repeated etiket elements are automatically turned into the array ["roman", "klasik"].
Example 2: The element <oda no="12">Deniz manzaralı</oda> has both an attribute and text. The tool gives this under the oda object as "@no": "12" and "#text": "Deniz manzaralı". If you know these two special key names, you will read the output correctly in your code.
Example 3: In the structure <liste><kisi><ad>Ali</ad></kisi><kisi><ad>Ayşe</ad></kisi></liste>, kisi appears twice, so liste.kisi becomes an array; it contains the objects {"ad": "Ali"} and {"ad": "Ayşe"}.
Tips and common mistakes: If there is only one of the same tag, the tool does not make it an array; with two, it does. So in your code, handle both the single-object and the array case. Values that look numeric may also be carried as text; convert them yourself if needed. Comments in the XML and some information about tag order may not be preserved in the JSON. Keys starting with @ in the output mean attributes; do not delete them.
When is it used? When you want to use an old SOAP or RSS response in a modern application.
Frequently asked questions
XML to JSON Converter – how to use it?
Fill in the fields and press the button; the result appears instantly. Example: <a x="1">t</a> → {"a":{"@x":"1","#text":"t"}}
XML to JSON 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.