# Convert JSON to XML

> Convert JSON to XML online. Free JSON to XML converter with a worked example — turns objects and arrays into nested XML elements.

Some legacy APIs, SOAP services, and config formats still speak XML. This converter maps a JSON object to nested XML elements, wrapping the document in a root node and turning array items into repeated elements.

## Example: JSON → XML

Input:
```
{
  "name": "Devkult",
  "stars": 1280,
  "tags": ["tools", "dev"],
  "open_source": true
}
```

Output:
```
<root>
  <name>Devkult</name>
  <stars>1280</stars>
  <tags>tools</tags>
  <tags>dev</tags>
  <open_source>true</open_source>
</root>
```

## How to convert JSON to XML

1. Paste your JSON object or array.
2. Each key becomes an XML element; nested objects become nested elements.
3. Arrays repeat the element, and special characters are XML-escaped.

## FAQ

### How are arrays represented in XML?

Each array entry is emitted as a repeated element with the same tag name, since XML has no native array type.

### Are attributes generated?

No. Every value becomes a child element rather than an attribute, which keeps the mapping simple and predictable.

## Related converters

- [JSON → YAML](https://www.devkult.com/convert/json-to-yaml.md)
- [JSON → CSV](https://www.devkult.com/convert/json-to-csv.md)
- [YAML → JSON](https://www.devkult.com/convert/yaml-to-json.md)

Open the interactive converter: https://www.devkult.com/convert/json-to-xml