JSON to XML
Convert JSON documents into clean, structured, and customizable XML markup instantly. · Updated
Options
Root tag name:
Indent size:
Attribute prefix:
json
Formatted Outputxml
Draft saved locally.
Options
| Option | Description |
|---|---|
| Root tag name | Name of the enclosing root XML element if the top-level JSON is an array or has multiple root keys. |
| Indent size | Number of spaces per nesting level in the output XML. |
| Attribute prefix | Prefix identifying object keys that should be serialized as XML element attributes. |
FAQ
How are XML attributes represented in JSON?
Properties starting with the attribute prefix (default '@_') such as '@_id': '101' are converted to XML tag attributes (<item id='101'>).
Can I convert JSON arrays to XML?
Yes. Arrays are converted into repeated child XML elements enclosed inside the chosen root tag.
Does the output include the standard XML declaration?
Yes, every generated XML output includes the standard '<?xml version="1.0" encoding="UTF-8"?>' header.
Can I adjust indentation?
Yes. Choose your desired indentation in the options panel (2 spaces, 4 spaces, etc.).
Related tools
XML to JSON
Convert XML documents into readable, valid JSON objects with automatic type parsing and attribute preservation.
XML Formatter
Format, beautify, and validate messy XML files with custom indentation and instant syntax error detection.
JSON Formatter
Format, validate, and explore JSON with a collapsible tree view.
Diff Checker
Compare two text or code snippets side-by-side to highlight added, removed, and modified lines instantly.