Code Beautifier

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

OptionDescription
Root tag nameName of the enclosing root XML element if the top-level JSON is an array or has multiple root keys.
Indent sizeNumber of spaces per nesting level in the output XML.
Attribute prefixPrefix 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.).