Paste JSON into the left panel and get well-formatted XML on the right. The converter preserves nesting, handles arrays, and adds an XML declaration header. Download the result as a .xml file.
JSON objects become XML elements, with keys as tag names and values as text content or nested elements. JSON arrays are repeated elements with the same tag name. Because XML requires a single root element, the top-level JSON object key becomes the root tag.
Example input:
{
"user": {
"name": "Alice",
"roles": ["admin", "editor"],
"active": true
}
}
Output XML:
<?xml version="1.0" encoding="UTF-8"?>
<user>
<name>Alice</name>
<roles>admin</roles>
<roles>editor</roles>
<active>true</active>
</user>
Key rules:
Most modern APIs use JSON, but XML is still required in several contexts.
Banking, government, ERP, and insurance systems frequently expose SOAP services that only accept XML. Web syndication formats — RSS and Atom — are XML, so generating a feed from a JSON content collection requires conversion. Office Open XML (docx, xlsx) files are ZIP archives of XML; some document generation pipelines use JSON as the source and need XML as an intermediate step.
Android string resources, layouts, and manifests are XML. A JSON localisation file often needs converting before it can be imported into an Android project. SVG is also XML, so data-driven chart generation sometimes starts from JSON and outputs SVG via XML conversion.
XML is more expressive than JSON in some ways (attributes, namespaces, mixed content) but has notable limitations when converting from JSON:
| JSON feature | XML equivalent | Notes |
|---|---|---|
| Object key | Element tag name | Tag names cannot start with numbers or contain spaces |
| Array | Repeated elements | No explicit array marker — inferred from repeated tags |
null | Empty element or absent | <field/> or omitted |
| Boolean | Text node | <active>true</active> |
| Number | Text node | No type information preserved |
| Root array | Not supported | XML must have a single root element |
Root array limitation — if your JSON is a top-level array rather than an object, you must wrap it in a root object key before converting. For example: { "items": [...] }.
The converter parses your JSON and maps each key to an XML element tag. Nested objects become nested elements, and arrays become repeated sibling elements. The output includes an XML declaration header.
Yes. Nested JSON objects are recursively converted to nested XML elements, preserving the full depth of your data structure.
JSON arrays are converted to repeated XML elements with the same tag name. For example, an array of three items under the key 'roles' becomes three <roles> elements.
Yes. XML requires a single root element, so your top-level JSON should be an object (not an array). If you have a root array, wrap it in an object first: { "items": [...] }.
Yes — use the XML to JSON tool on JSONbite. It handles attributes, nested elements, repeated tags, and namespaces.
No. Conversion runs entirely in your browser using the fast-xml-parser library. Your data never leaves your machine.
More Tools