JSON to XML Converter
This tool converts JSON to XML. Objects become nested elements, lists become repeated elements, and special characters are escaped.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use JSON to XML Converter online
- Paste the JSON. Type or paste the text.
- Set the root. Choose the root name and item name.
- Choose the layout. Indent and the XML declaration.
- 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?
What happens to invalid names?
Are special characters escaped?
Can I set the root name?
Does it write attributes?
Is the JSON to XML Converter private?
Can I save what the JSON to XML Converter gives me?
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.