ToolStudio.es
In your browser1 Free Trial

Convert JSON to XML

Turn JSON into well-formed XML, with the root element of your choice, attributes and special characters escaped.

Free try: process 1 document (pasted or 1 file) and change the options as often as you like. Errors do not use up your try.
Input · JSON

Everything runs in your browser: your data is never sent to a server.

Result · XML
Indentation

Attributes are written as “@name” and text next to other nodes as “#text”. Repeated elements become a list.

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

  1. Paste the JSON or open a .json file.
  2. Type the name of the root element (“root” by default).
  3. Pick the indentation and whether you want the <?xml version="1.0"?> declaration.
  4. 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.

Related tools

Development

XML to JSON Converter

Convert XML to JSON: attributes become “@name”, repeated elements become lists and text becomes values. If the XML is not well formed, it shows the line of the error.

XMLJSONRSS
Try this tool
Development

JSON to YAML Converter

Convert JSON to YAML with 2 or 4 space indentation. Quotes are added only where needed, so “28001” or “yes” stay text, and key order is kept.

JSONYAML
Try this tool
Development

JSON Formatter

Paste minified or messy JSON and get it back indented with 2 or 4 spaces or tabs, with sorted keys if you want. Any error is shown with its line and column.

JSON
Try this tool
Development

JSON to CSV Converter

Convert JSON to CSV with one column per key, flatten nested objects (“address.city”) and choose comma or semicolon as the delimiter. The CSV opens in Excel with accents intact.

JSONCSVExcel
Try this tool
Featured on TinyShelf