JSON to XML. A new structure.
Turn JSON objects and arrays into readable XML, with clear type information and safely escaped values.
Your workspace
JSONInput
Your JSON goes hereJSON editor. Tab inserts indentation. Shift plus Tab moves focus to the previous control.
Output
JSON{
"project": "jsonformatkit",
"description": "A little clarity for your data",
"version": "1.0.0",
"isAwesome": true,
"tools": [
"Format & validate",
"Convert & explore",
"Share something beautiful"
],
"settings": {
"indentation": 2,
"sortKeys": false,
"privacy": "Your data stays yours"
},
"madeWith": "care",
"nextBigIdea": null
}Object with 11 keys. All brackets, quotes, and commas are in their happy place.
Arrays use <item>, values include type attributes, and incompatible keys use <property name="…">. XML-incompatible characters become �.
More than a pretty print.
Convert nested JSON into readable XML
XML represents data with elements and attributes, while JSON uses objects, arrays, and primitive values. This converter wraps your JSON in a root element and records each value's type so the generated XML makes its mapping explicit.
Objects become nested elements. Arrays use item elements, including arrays of objects. Null values use empty elements with a null type. XML-sensitive characters such as ampersands and angle brackets are escaped before they are written to the output.
Some JSON keys cannot be XML element names. Keys with spaces, invalid starting characters, or the reserved xml prefix become property elements with a name attribute. Characters that XML 1.0 cannot represent are replaced by the replacement character. Check your receiving system's expected schema; this tool's mapping may differ from its XML contract.
How to use JSON to XML
- Paste or upload valid JSON; XML is already selected on this page.
- Select Convert to XML and inspect the root, nested elements, and type attributes.
- Download the .xml file, copy the text, or export a PDF for review.
Up to 2 MB of JSON and 100 nesting levels. URL imports require public HTTPS sources with CORS enabled.
A small example
{"name":"Ada","active":true}<?xml version="1.0" encoding="UTF-8"?>
<root type="object">
<name type="string">Ada</name>
<active type="boolean">true</active>
</root>Frequently asked questions
How are JSON arrays represented in XML?
An array element has type="array" and contains one item element per entry. Each item has its own type, so arrays can contain primitives, objects, other arrays, or null.
What happens to JSON keys with spaces?
A key that cannot be a safe XML element name becomes a property element whose name attribute contains the escaped original key. The value is still represented inside that element.
Does the output conform to my application's XML schema?
Not automatically. There is no single universal JSON-to-XML mapping. This converter uses root, item, property, and type attributes; compare that mapping with your receiving application's schema before importing it.
Built around open standards: JSON (RFC 8259), JSON Schema, and YAML 1.2.