Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

JSON to XML Converter

This tool converts JSON to XML. Objects become nested elements, lists become repeated elements, and special characters are escaped.

How to use JSON to XML Converter online

  1. Paste the JSON. Type or paste the text.
  2. Set the root. Choose the root name and item name.
  3. Choose the layout. Indent and the XML declaration.
  4. Copy the XML. Copy or save the result.

Why use this free JSON to XML Converter

  • Nested elements
  • Lists as repeated elements
  • Names made safe
  • Special characters escaped
  • Root and item names
  • Share by link

How the conversion works

Each key of a JSON object becomes an XML element with the same name. A value that is text, a number or true or false becomes the text of the element. A list repeats the element once for each item. An empty object or null becomes an empty element. The result is indented the way you choose.

Names and escaping

XML element names cannot hold spaces and cannot start with a digit, so the tool changes unsuitable names: a space becomes an underscore, and a name that begins with a digit gets an underscore in front. The characters &, < and > in values are escaped, so the XML stays valid.

A worked example

The JSON with a user object, a list of two tags and a true value becomes this XML with the root named data:\n Ann a b true \nThe tags list is written as two tags elements. The result is 157 characters long.

The root element

XML must have a single root element, while JSON can be a list or a plain value. You can set the root name, and for a top-level list you can set the name used for each item. The XML declaration at the start can be switched off if you are inserting the result into another document.

What is not covered

JSON has no attributes, so everything becomes an element. The mapping is not reversible in every case, because XML cannot tell a one-item list from a single value. If you need attributes or a special layout, edit the result by hand or write a stylesheet.

Using the tool

The JSON to XML Converter works again whenever the text or an option changes. Find and replace is built into the editor with Ctrl+F and Ctrl+H.

JSON to XML Converter: frequently asked questions

How do lists become XML?
The element is repeated once for each item.
What happens to invalid names?
Spaces and symbols become underscores, and a leading digit gets an underscore.
Are special characters escaped?
Yes: & becomes &amp; and < and > are escaped too.
Can I set the root name?
Yes, in the root element box.
Does it write attributes?
No. All values become elements.
Is the JSON to XML Converter private?
It stays in your browser tab; the JSON to XML Converter sends nothing anywhere.
Can I save what the JSON to XML Converter gives me?
Yes. Copy the JSON to XML Converter result, or press Use result as input and carry on with the new text.

Related searches for JSON to XML Converter

  • JSON to XML Converter online
  • free JSON to XML Converter
  • JSON to XML Converter online free
  • JSON to XML Converter for mobile
  • JSON to XML Converter without sign up
  • convert json to xml converter
  • json to xml converter converter
  • JSON to XML Converter – Text & Writing Tools

JSON to XML Converter is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.

More tools in Text & Writing Tools →

Search tools