Input (XML)
<user id="1">
<name>Ada</name>
<active>true</active>
</user>The XML → JSON tool parses XML markup and produces an equivalent JSON object, turning elements into keys, nested elements into nested objects, and repeated sibling elements into arrays. Attributes and text content are mapped using consistent conventions. This is useful when consuming XML feeds, SOAP responses, or legacy data in modern JavaScript applications that work most naturally with JSON.
XML is a verbose, tag-based markup language with elements, attributes, namespaces, and a single root, while JSON is a concise format built from objects, arrays, and primitive values. Because XML carries information that JSON lacks a direct slot for — attributes versus child text, for example — converters adopt conventions such as prefixing attribute keys, so the resulting JSON faithfully reflects the original document's structure.
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</name>
<active>true</active>
</user>{
"user": {
"@id": "1",
"name": "Ada",
"active": "true"
}
}<list>
<item>a</item>
<item>b</item>
</list>{
"list": {
"item": ["a", "b"]
}
}<order>
<id>7</id>
<customer>
<name>Ada</name>
</customer>
</order>{
"order": {
"id": "7",
"customer": {
"name": "Ada"
}
}
}<price currency="USD">9.99</price>{
"price": {
"@currency": "USD",
"#text": "9.99"
}
}<config>
<flag/>
<name>app</name>
</config>{
"config": {
"flag": null,
"name": "app"
}
}<note>
<text>Ben & Jerry</text>
</note>{
"note": {
"text": "Ben & Jerry"
}
}<users>
<user><name>Ada</name></user>
<user><name>Linus</name></user>
</users>{
"users": {
"user": [
{ "name": "Ada" },
{ "name": "Linus" }
]
}
}The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste XML markup and get an equivalent JSON object back.
Elements become keys and nested elements become nested objects.
Repeated sibling elements collapse into JSON arrays.
Attributes are mapped using a consistent prefix so they aren't confused with child elements.
Element text content is placed into its own conventional key.
Namespaces and the single root are reflected in the resulting structure.
Consuming XML feeds or SOAP responses in JavaScript apps that prefer JSON.
Bringing legacy XML data into a modern JSON workflow.
Parsing runs locally in your browser — your XML never reaches a server.
Suitable for confidential SOAP or feed payloads.
Output
JSON output