JSON to XML

Convention: keys starting with @ become attributes, #text becomes element text, arrays become repeated elements.

Runs in your browser. Nothing is uploaded.
JSON in
XML out

JSONYard's online JSON to XML converter transforms JSON into XML using the conventional `@key` for attributes, `#text` for element text, and repeated elements for arrays. It runs entirely in your browser.

Wondering which format fits your use case? Read JSON vs YAML vs XML: when to use which.

Conventions used

  • { "@id": "1", "#text": "hi" }<tag id="1">hi</tag>
  • { "item": [1, 2, 3] }<item>1</item><item>2</item><item>3</item>
  • null → self-closing element

When you need JSON converted to XML

XML still rules whole categories of software: SOAP services, RSS/Atom feeds, OOXML documents, Android resource files, and most enterprise messaging. Converting JSON to XML lets a JSON-native client talk to systems that haven't moved off SOAP or that demand schema-validated XML. If you're comparing the formats on their merits, see JSON vs YAML vs XML: when to use which.

FAQ

Is JSON to XML lossless?
Not always. XML has things (mixed content, processing instructions, namespaces, ordered children of different types) that JSON can't express cleanly. The output is good for most data documents, not arbitrary XML.
Can I customize the root element?
Currently the root is <root>. A custom root name option is on the roadmap.
How do I convert JSON to XML online without uploading?
Paste your JSON into the left pane and click Convert — everything runs in your browser. Nothing is sent to a server.

Related conversion tools