Paste JSON or open a .json file and get well-formed XML instantly. Each key becomes an element, arrays become repeated elements with the same name, and special characters such as < and & are escaped for you. Choose the name of the root element, the name used for items of a top-level array, the indentation and whether to add the XML declaration.
Keys that start with @ become attributes and a #text key becomes the element's text, so you can produce exactly the XML a system expects. Key names that are not allowed in XML, such as names with spaces or starting with a digit, are fixed automatically.
How to use the JSON to XML tool
- Paste your JSON or open a .json file.
- Set the root element name and the array item name.
- Choose indentation and whether to include the XML declaration.
- Copy the XML or download it as a .xml file.
Why use ToolOrca JSON to XML
- Custom root and item element names
- Attributes with @ keys, text with #text
- Arrays as repeated elements
- Automatic escaping and name fixing
- Optional XML declaration
- Runs fully in your browser
How JSON maps to XML
{"user": {"@id": 7, "name": "Ana"}} becomes <user id="7"><name>Ana</name></user>. An array such as {"tag": ["a", "b"]} becomes two <tag> elements. null values become empty elements like <note/>.
XML element names cannot contain spaces or start with a digit, so a key like "1st place" is written as <_1st_place>.
Frequently asked questions
Why is there a root element?
A well-formed XML document must have exactly one root element. If your JSON is an array or has several top-level keys, they are wrapped in the root element you name.
How do I create XML attributes?
Prefix the key with @, for example {"book": {"@lang": "en", "#text": "Dune"}} gives <book lang="en">Dune</book>.
Are numbers and booleans kept?
They are written as text, because XML has no data types without a schema. 42 becomes <n>42</n>.
Is my JSON uploaded?
No, the conversion runs entirely in your browser.