JSON to XML Converter
Developer Tools
Convert JSON data into well-formed XML with a configurable root element name. Arrays become repeated `<item>` elements.
Runs entirely in your browserAbout JSON to XML Converter
The JSON to XML Converter is a quick bridge between two common interchange formats. It's useful when an upstream system speaks JSON but a downstream system expects XML — for example, posting to a SOAP endpoint, generating an RSS feed from a JSON content source, or producing XML for systems that haven't adopted JSON.
The converter wraps your JSON inside a configurable root element (so the XML output is always a single-rooted, well-formed document). Object keys become element names. Arrays become repeated `<item>` elements under the parent key, since XML has no native array concept. Primitive values become text nodes. The output is pretty-printed with two-space indentation by default. Everything runs in your browser via `fast-xml-parser`.
How to use
- 1
Paste your JSON
Drop the JSON object or array into the input editor.
- 2
Set the root element name
Use the Root element name field. The default is `root`; pick something meaningful like `order`, `feed`, or `book`.
- 3
Copy or download the XML
Use the Copy or Download (.xml) button next to the output editor.
Examples
JSON object with an array
Arrays become repeated `<item>` elements under the array's parent key.
Input
{
"id": 1,
"name": "Ada",
"skills": ["math", "computer science"]
}Output
<root>
<id>1</id>
<name>Ada</name>
<skills>
<item>math</item>
<item>computer science</item>
</skills>
</root>Frequently asked questions
Why are array elements named `<item>`?+
XML has no array concept, so we need to name each element. `<item>` is a neutral, conventional choice. If you need a specific tag (e.g. `<book>` inside `<books>`), post-process the output or restructure the JSON first.
How are special characters handled?+
Standard XML escaping is applied — `<`, `>`, `&`, `'`, and `"` are replaced with their XML entities so the output is valid.
Can I get back the original JSON?+
Use the XML to JSON Converter to round-trip. Arrays come back faithfully when wrapped in the same `<item>` convention.
Is the conversion lossless?+
For typical data, yes. JSON null is rendered as an empty element; numbers and booleans become text nodes (XML has no type system, so they're strings on the other side).
Is my data sent anywhere?+
No — the conversion runs entirely in your browser.
Related tools
JSON Formatter
Format, beautify, and explore JSON with an expandable tree view. Includes indent control and minify.
JSON Validator
Validate JSON structure and pinpoint syntax errors by line and column.
HTML Formatter
Clean and indent messy HTML for better readability.
CSS Formatter
Format and organize CSS automatically with configurable brace and indent styles.
SQL Formatter
Beautify SQL queries with proper indentation across Postgres, MySQL, SQLite, and MSSQL dialects.
XML Formatter
Format XML into a clean, readable structure with attribute control.