XML to JSON Converter
Convert XML to JSON instantly, live as you type.
Converts live as you type, entirely in your browser. There's no single official XML-to-JSON standard โ repeated sibling elements with the same tag name become an array, the most common convention. Invalid XML shows the parser's exact error message.
Need the opposite? JSON to XML Converter
What is XML to JSON Converter?
Paste XML and get an equivalent JSON document instantly, using your browser's native XML parser rather than a hand-rolled one, so parsing behaves the same way a browser would treat the markup. There's no single official XML-to-JSON standard, but repeated sibling elements with the same tag name become an array here, the most common convention followed by most other XML-JSON converters, so results are easy to reason about if you've used a similar tool before. Handy for working with legacy APIs or config formats that only speak XML when the rest of your tooling expects JSON: SOAP responses, RSS/Atom feeds, or an old settings file. Conversion happens live as you type, entirely in your browser; nothing you paste is sent to a server.
How to Use the XML to JSON Converter
- 1
Paste the XML: Enter any well-formed XML document, such as a SOAP response or RSS feed.
- 2
Read the JSON Result Instantly: The equivalent JSON structure appears automatically as you type.
- 3
Copy the Result: Use the copy button to copy the JSON for use in your application.
How the Mapping Works
Each XML element becomes a JSON key, with its content as the value. A single child element becomes a plain object; multiple sibling elements sharing the same tag name become a JSON array under that key, since JSON has no native way to represent repeated keys the way XML naturally allows repeated tags. Element attributes are kept alongside the element's content rather than discarded, so no information from the original XML is lost in the conversion.
Example
Input XML:
<book id="1">
<title>Dune</title>
<author>Frank Herbert</author>
</book>
Output JSON:
{
"book": {
"@id": "1",
"title": "Dune",
"author": "Frank Herbert"
}
}
With repeated sibling elements, e.g. multiple <author> tags under one <book>, the author key becomes a JSON array of strings instead of a single string, since there's more than one value to hold.Frequently Asked Questions
Common questions about XML to JSON Converter.