onlinexmltools logo

Xml to json converter

World's simplest xml tool

Free online XML to JSON converter. Just paste your XML in the form below and it will automatically get converted to JSON. There are no ads, popups or nonsense, just an awesome XML to JSON converter. Paste XML, get JSON. Created by developers for developers.
sneak preview sssshhhhh
We're working on a new site – Online Text Tools – utilities for text processing. Check it out!
fullscreen fullscreen_exit
Indentation
Indent output with spaces
How many spaces per indent? Set to 0 to output minified JSON
Indent output with tabs
Xml to json converter tool What is a xml to json converter?
This tool converts Extensible Markup Language (XML) documents to JavaScript Object Notation (JSON) documents. Additionally you can change indentation and set it to spaces or tabs. If you set it to zero spaces, the output JSON will be compressed.
Xml to json converter examples Click to use
Transform XML to JSON
This example transforms a super simple XML document with one node to JSON data format.
<root> <branch>leaf</branch> </root>
{ "branch": "leaf" }
Convert a nested XML tree
This example converts a complex XML tree into JSON format.
<products> <available> <product> <name>pen blue</name> <count>22</count> </product> <product> <name>pen red</name> <count>17</count> </product> <product> <name>paper, letter</name> <count>50</count> </product> </available> <queued> <queue_delayed> <product> <name>colored pencils</name> <count>10</count> </product> </queue_delayed> <queue_active> <product> <name>stapler</name> <count>15</count> </product> <product> <name>document holder</name> <count>5</count> </product> </queue_active> </queued> </products>
{ "available": { "product": [ { "name": "pen blue", "count": "22" }, { "name": "pen red", "count": "17" }, { "name": "paper, letter", "count": "50" } ] }, "queued": { "queue_delayed": { "product": { "name": "colored pencils", "count": "10" } }, "queue_active": { "product": [ { "name": "stapler", "count": "15" }, { "name": "document holder", "count": "5" } ] } } }
Pro tips Master online xml tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinexmltools.com/convert-xml-to-json?input=%3Croot%3E%0A%20%20%3Cbranch%3Eleaf%3C%2Fbranch%3E%0A%3C%2Froot%3E
All xml tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly beautify an XML data structure.
Quickly compress an XML data structure.
Quickly check XML for errors and report them.
Quickly highlight the syntax of an XML document.
Quickly convert XML code to an image.
Quickly convert an XML document to a JSON document.
Quickly convert a JSON document to an XML document.
Quickly convert an XML document to a CSV document.
Quickly convert a CSV document to an XML document.
Quickly convert an XML data structure to YAML markup.
Quickly convert a YAML document to XML data.
Quickly convert an XML document to a TSV file.
Quickly convert a TSV document to an XML file.
Quickly convert an XML data structure to Base64 encoding.
Quickly decode a Base64-encoded XML data structure.
Quickly convert an XML file to URL percent-encoding.
Quickly convert a URL percent-encoded XML file to XML.
Quickly convert an XML file to a plain text document.
Quickly edit an XML document in a browser-based XML editor.
Coming soon These xml tools are on the way
Display XML Statistics
Display detailed information about an XML data structure.
Compare Two XML Files
Diff XML documents and show file differences visually.
Truncate XML
Loop over XML and truncate all tags, elements and values.
Convert XML to Bencode
Convert an XML document to Bencode encoding.
Convert Bencode to XML
Convert Bencode data structure to XML file.
Convert XML to BSON
Convert an XML document to Binary JSON (BSON).
Convert BSON to XML
Convert BSON (Binary JSON) to XML data structure.
Convert XML to Data URI
Convert an XML config to data URL encoding.
Convert XML to PHP Array
Convert XML data to PHP data structure.