JSON to XML

Convert JSON documents to structured XML online. Features standard attribute mapping (`@_attribute`), inner text mapping (`#text`), and automatic translation of JSON arrays into repeated sibling XML tags.

Private • In-browser processing • Zero server uploads

Interactive workspace loading...

How to Use JSON to XML

1
Paste JSON
Paste your JSON object or drop a .json file into the input editor.
2
Configure Root Tag
Specify a custom Root Element Tag (e.g., 'root', 'config', or 'data') if your JSON has multiple top-level keys.
3
Copy XML
The formatted XML is generated instantly, ready to copy or download as an .xml file.

Key Features

Attribute Mapping Convention
Any JSON key prefixed with `@_` (e.g. `"@_id": "101"`) is automatically serialized as an XML attribute (`id="101"`).
Inner Text Node Support
A JSON key named `#text` defines the inner text of an XML element when attributes or other children are present.
Array to Sibling Elements
JSON arrays (e.g. `"item": ["A", "B"]`) are converted into clean repeated XML tags (`<item>A</item><item>B</item>`).
Proper Entity Escaping
Automatically escapes reserved XML characters (`<`, `>`, `&`, `"`, `'`) in both text nodes and attribute values.

Common Use Cases

  • Creating XML payloads for legacy enterprise SOAP Web Services from modern JSON APIs.
  • Generating XML sitemaps, RSS feeds, and product catalogs from JSON databases.
  • Converting JSON configuration structures into Android XML or Maven POM files.
  • Transforming application state into SVG vector files.

Frequently Asked Questions

Prefix the attribute key with `@_`. For example, `{ "user": { "@_id": "42", "name": "Alice" } }` converts to `<user id="42"><name>Alice</name></user>`.

Use `#text`. For example, `{ "button": { "@_type": "submit", "#text": "Click Me" } }` converts to `<button type="submit">Click Me</button>`.

Arrays generate repeated sibling elements with the array key name. For example, `{ "colors": { "color": ["red", "blue"] } }` converts to `<colors><color>red</color><color>blue</color></colors>`.