How JSON maps to XML
Many legacy systems, SOAP services, feeds and invoicing or logistics software still require XML. This tool turns each JSON key into an XML element and each value into its content.
Arrays repeat the element: {"book": [..., ...]} produces two <book> elements. Keys starting with “@” become attributes and “#text” becomes the element's text, the same convention the XML to JSON converter uses, so you can go back and forth.
The characters &, < and > are escaped, and names that aren't valid in XML (with spaces or starting with a number) are fixed with an underscore. You can choose the name of the root element, the name of list items and whether to include the <?xml?> declaration.
How to convert JSON to XML
- Paste the JSON or open a .json file.
- Type the name of the root element (“root” by default).
- Pick the indentation and whether you want the <?xml version="1.0"?> declaration.
- Click “Convert to XML” and copy or download the .xml file.
When to use it
- Sending data to a SOAP service or a system that only accepts XML.
- Generating a feed or an exchange file from a JSON API.
- Preparing data for invoicing, ERP or logistics tools.
- Creating XML test files from data you already have in JSON.
Frequently Asked Questions
How do I create XML attributes?
Put “@” in front of the key name: {"product": {"@id": "7", "name": "Book"}} produces <product id="7"><name>Book</name></product>.
What if the JSON is an array?
It's wrapped in the root element and each item is written with the element name you choose (“item” by default).
What if a key has spaces or starts with a number?
XML doesn't allow those names, so they're fixed: “first name” becomes first_name and “1st” becomes _1st.
Is my data sent to a server?
No. Everything is processed in your browser with JavaScript. The text you paste and the files you open never leave your device, so you can safely work with internal or customer data.
Is it free?
Yes. You can try the tool for free on one document (pasted or a single file) and change the options as often as you like; attempts that end in an error don't use up your free try. For unlimited use and processing several files at once, ToolStudio Pro costs €1.99 a month and includes every tool.