Convert between JSON and XML instantly in your browser — format, minify, validate, and copy with one click.
JSON supports arrays natively with
[]
while XML represents them as repeated sibling elements. JSON has no concept of attributes — everything is a key-value pair. XML supports mixed content (text + child elements), which has no direct JSON equivalent.
XML requires a single root element. When converting a JSON object, the root key becomes the XML root. When converting a JSON array (which has no named root), a synthetic root element name like
<root>
is needed to produce valid XML.
XML is entirely text-based — all values are strings. When converting XML → JSON, numeric strings like
"42"
and boolean strings like
"true"
can be coerced to their native JSON types. Use the "Auto-detect" option to enable this, or "Keep as strings" for lossless round-tripping.
XML attributes (e.g.
<item id="5">
) have no JSON counterpart. This converter maps them to JSON keys with a configurable prefix (default
@
), so
id="5"
becomes
"@id": "5"
. When converting JSON → XML, keys with the
@
prefix become XML attributes.