XML to JSON Converter Online Tool



About XML to JSON Converter Online Tool:

This online xml to json converter tool helps you to convert raw xml format string to json format string.

comic xml to json

Similarities of JSON and XML

Both XML and JSON are a common format for describing data. They are language-independent. A data description is language-independent. Exchanging data between different programming languages means one language can be used to call another language, which provides great convenience for development process.

For example, the following data about cities in Canada is represented by XML and JSON seperetaly, the content is exactly the same, Which one do you like more?

<country>
	<name>Canada</name>
	<province>
		<name>Ontario</name>
		<cities>
			<city>Toronto</city>
			<city>Ottawa</city>
		</cities>
	</province>
	<province>
		<name>British Columbia</name>
		<cities>
			<city>Vancouver</city>
			<city>Victoria</city>
			<city>Richmond</city>
		</cities>
	</province>
</country>
{
    "country": {
        "name": "Canada",
        "province": [{
            "name": "Ontario",
            "cities": {
                "city": ["Toronto", "Ottawa"]
            }
        }, {
            "name": "British Columbia",
            "cities": {
                "city": ["Vancouver", "Victoria", "Richmond"]
            }
        }]
    }
}

Does XML to JSON Converter Online Tool log my data?

Absolutely NOT, this XML to JSON Converter doing all the formatting work on the client side, all logic are implemented by Javascript. There are 2 major advantages: 1.Your data never transmitted in the Open Internet, so you know it's secure; 2.It's much faster than doing all the work in the server side, because there is no Internet Delay.

More information about XML to JSON Converter:

Github: https://github.com/martinblech/xmltodict

xmltodict: http://docs.python-guide.org/en/latest/scenarios/xml/

XML to JSON Converter with Python (with package xmltodict):

import xmltodict


def convert_xml_to_json(input_str):
    dict = xmltodict.parse(input_str, process_namespaces=True)
    return json.dumps(dict, indent=4)