XML to JSON
Convert XML to JSON with attributes, repeated elements as arrays, and automatic number and boolean detection.
Convert JSON to clean, well-formed XML instantly. Free, private, and 100% in your browser.
JSON and XML are both widely used formats for exchanging structured data. Many modern APIs speak JSON, while enterprise systems, SOAP services, RSS feeds, and configuration formats often require XML. This tool converts JSON to XML in one step, with sensible conventions and options you control.
Special characters are escaped and invalid key names are fixed automatically, so the XML always parses.
Keys starting with @ become XML attributes, and a #text key becomes the element's text content.
Choose the root element name and the element name used for array items.
Indent with 2 or 4 spaces or tabs, and include or omit the XML declaration.
Your JSON is validated as you type, with the exact line and column of any error.
The conversion runs entirely in your browser. Your data is never uploaded.
{
"book": {
"@id": "bk101",
"title": "Clean Code",
"authors": ["Robert C. Martin"],
"price": 32.5,
"available": true
}
}<?xml version="1.0" encoding="UTF-8"?>
<root>
<book id="bk101">
<title>Clean Code</title>
<authors>Robert C. Martin</authors>
<price>32.5</price>
<available>true</available>
</book>
</root>
An array under a key becomes repeated elements with that key's name. For example, "tags": ["a", "b"] becomes <tags>a</tags><tags>b</tags>. Arrays without a key, such as a top-level array, use the Array item element name (item by default).
Prefix a key with @. For example, {"book": {"@id": "bk101"}} becomes <book id="bk101"/>. Use a #text key to set the element's text content next to its attributes.
XML element names cannot contain spaces or start with a digit. Invalid characters are replaced with underscores, and names that start with a digit or with "xml" get an underscore prefix, so the output is always well-formed.
A null value becomes an empty, self-closing element, such as <middleName/>.
No. The converter runs entirely in your browser using JavaScript. Your JSON never leaves your device.
Convert XML to JSON with attributes, repeated elements as arrays, and automatic number and boolean detection.
Turn JSON arrays into CSV for Excel or Google Sheets, with nested object flattening and custom delimiters.
Convert JSON to clean, readable YAML for Kubernetes, Docker Compose, CI pipelines, and config files.
Encode JSON as Base64 or base64url for headers, tokens, environment variables, and data URIs.