---
title: "JSON XML Converter"
description: "Convert JSON to XML and XML to JSON online, both directions on one page. Keeps attributes with the @ prefix and text content with #text, so a document survives the round trip. Runs in your browser."
url: https://findutils.com/convert/json-to-xml/
category: convert
---

# JSON XML Converter

Convert JSON to XML and XML to JSON online, both directions on one page. Keeps attributes with the @ prefix and text content with #text, so a document survives the round trip. Runs in your browser.

**Use this tool:** [JSON XML Converter](https://findutils.com/convert/json-to-xml/)

## Programmatic access

- REST id `json-to-xml`: POST https://api.findutils.com/api/tools/json-to-xml/execute (reference: https://findutils.com/api/json-to-xml/)
- MCP tool `json_to_xml` on https://mcp.findutils.com (reference: https://findutils.com/mcp/json-to-xml/)

## Why Use JSON to XML Converter?

JSON to XML conversion is needed when integrating with legacy systems, SOAP APIs, or XML-based configurations. This tool preserves data structure and supports attribute notation.

## Tips for Better Conversions

- Use the @-prefix to create XML attributes instead of child elements, e.g. {"@id": "5"} becomes id="5" on the parent tag.
- Set a meaningful root element name like "order" or "config" instead of the default "root" to produce self-documenting XML.
- Enable the XML declaration when saving as a standalone.xml file or sending as an HTTP payload with Content-Type application/xml.
- Validate your JSON first with a formatter to catch syntax errors before conversion.
- For deeply nested JSON, enable pretty-print to visually inspect the XML hierarchy and spot mapping issues.

## FAQ

### How do I specify XML attributes?

Use the @ prefix for attributes in your JSON. For example, { "@id": "123", "#text": "content" } creates <element id="123">content</element>.

### How are arrays converted?

JSON arrays become repeated XML elements with the same tag name. For example, { "items": [1, 2, 3] } becomes <items>1</items><items>2</items><items>3</items>.

### What if my JSON has multiple root keys?

When JSON has multiple root keys, they are wrapped in a root element (default: 'root'). You can customize the root element name in the options.

### Does this converter require a signup?

No. It is available with no signup, no limits. All processing happens in your browser.

### Is my data safe when converting JSON to XML online?

Yes. The conversion runs entirely in your browser. Your data is never sent to any server, making it safe for sensitive information.

### How are null values handled in the XML output?

Null values in JSON are converted to empty XML elements. For example, { "field": null } produces <field></field> or <field/> depending on the formatting options.

### Can I convert deeply nested JSON to XML?

Yes. The tool recursively processes nested objects and arrays to any depth, producing XML elements that mirror the original JSON hierarchy.

### What is the maximum JSON size I can convert?

The limit depends on your device memory since conversion runs in the browser. Most modern browsers handle files up to several megabytes.

### Does the output include an XML declaration?

Optionally. Toggle the Include XML declaration option to prepend the standard XML header. Recommended when saving as a standalone.xml file.

### Can I convert XML back to JSON?

Yes. Use the companion XML to JSON Converter for the reverse transformation, preserving attributes and nested structures.

### How are XML attributes converted?

When 'Preserve attributes' is enabled, XML attributes are converted to JSON properties with an @ prefix. For example, <book category="fiction"> becomes { "@category": "fiction" }.

### What happens with repeated elements?

Elements with the same name are automatically converted to JSON arrays. For example, multiple <item> elements become an items array.

### Is the conversion reversible?

Generally yes, but some XML features like processing instructions or comments are not preserved. Use the JSON to XML tool for reverse conversion.

## Related Tools

- [JSON Formatter](https://findutils.com/developers/json-formatter/)
- [JSON YAML Converter](https://findutils.com/developers/json-yaml-converter/)
- [XML Formatter](https://findutils.com/developers/xml-formatter/)
- [JSON to CSV](https://findutils.com/convert/json-to-csv/)
- [JSON Visualizer](https://findutils.com/developers/json-visualizer/)
- [JSON to TypeScript](https://findutils.com/developers/json-to-typescript/)
