About the XML to JSON Converter
Many applications expect JSON, while older enterprise systems, SOAP APIs, RSS feeds and sitemaps use XML. Parsing XML structure requires significantly more complex code since JSON specification does not include XML attributes or text nodes. This XML to JSON Converter helps developers to transform their data into a simpler format without losing any of the attributes or text nodes. Our utility gives you full control over how exactly to format the text nodes and attributes according to your needs.
Our converter is perfect for developers that work with enterprise or financial data and prefer to keep their information strictly private. The parsing happens in your browser, so your XML is not uploaded to our servers.
Key Features of XML to JSON Converter
- Parse XML AttributesJSON data format does not have attributes. The best practice is to store them in separate object under @attributes key. You can select how exactly to format the attributes using the dropdown menu (Include as @attributes)
- Text nodesSome of the XML tags can have both attributes and text. In this case, the text is stored as a text node. You can choose how exactly to store the text nodes using the second dropdown (Include as #text). This option is especially useful when parsing data from enterprise APIs.
- SampleNot sure how XML to JSON parsing will affect your data structure? Use the sample button to see the exact parsing of nested objects.
- Local processingThe conversion runs in your browser, so the content is not uploaded to our servers.
- Export JSON codeUse the Copy button to copy the resulting JSON code straight into your application or documentation. Alternatively, you can use the Download JSON button to save the file on your computer.
How to Use XML to JSON Converter
- Open the XML input field and enter your XML code (or click the Sample button to see an example)
- Select how to parse XML attributes using the Attributes dropdown
- Select how to parse XML text nodes using the Text nodes dropdown
- Click Convert button (the purple button on the right)
- View your parsed JSON data in the output window below
- Click Copy to copy the JSON code into your application or documentation. Alternatively, you can also use the Download JSON option.
- Use the Clear button to reset the XML and JSON fields and start the process over.
XML to JSON Converter Examples
Shows how an XML attribute and a repeated element appear in JSON.
<user id="7"><name>Omar</name><role>editor</role><role>author</role></user>
{
"user": {
"@attributes": {
"id": "7"
},
"name": "Omar",
"role": [
"editor",
"author"
]
}
}