Input (JSON)
{
"user": {
"id": 1,
"name": "Ada"
}
}The JSON ↔ XML converter turns JSON data into equivalent XML markup and XML back into JSON. Object keys become element names, nested objects become nested elements, and arrays become repeated elements. This is useful when integrating with systems that expect XML — such as legacy SOAP services or RSS-style feeds — while your application works natively in JSON, or vice versa when consuming XML feeds in a JSON pipeline.
JSON represents data as key/value objects and arrays and is the default for modern web APIs. XML is a verbose, tag-based markup language that wraps data in named, nestable elements with optional attributes and a single root. The two models are similar but not identical: XML distinguishes attributes from child elements and has no native array type, so the converter applies consistent conventions to bridge those differences in both directions.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
{
"user": {
"id": 1,
"name": "Ada"
}
}<user>
<id>1</id>
<name>Ada</name>
</user><book>
<title>SQL</title>
<pages>120</pages>
</book>{
"book": {
"title": "SQL",
"pages": "120"
}
}{
"list": {
"item": ["a", "b"]
}
}<list>
<item>a</item>
<item>b</item>
</list><order>
<id>7</id>
<customer>
<name>Ada</name>
</customer>
</order>{
"order": {
"id": "7",
"customer": {
"name": "Ada"
}
}
}{
"catalog": {
"book": {
"title": "SQL",
"author": "Ada"
}
}
}<catalog>
<book>
<title>SQL</title>
<author>Ada</author>
</book>
</catalog>{
"a": {
"@id": "1",
"#text": "Ada"
}
}<a id="1">Ada</a><price currency="USD">9.99</price>{
"price": {
"@currency": "USD",
"#text": "9.99"
}
}The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste JSON to produce equivalent XML markup, or paste XML to get JSON back.
Object keys become element names and nested objects become nested elements.
JSON arrays become repeated sibling elements with the same tag name.
XML has no native array type, so repeated elements stand in for list items.
Attributes are distinguished from child elements using consistent conventions.
A single XML root wraps the JSON structure as required by XML.
Feeding JSON data to legacy SOAP services or RSS-style feeds that expect XML.
Consuming an XML feed inside a JSON-native pipeline.
Both conversions run locally in your browser — your data is never sent anywhere.
Works offline once the page has loaded.
Output
XML output