Convert XML to JSON format instantly. Transform XML data into structured JSON for modern web applications. Free online converter.
Input
Valid XML with proper structure and encoding declaration.
Output
Paste input and click
Convert to JSON to see results.
Need to do this on any website, at scale?
Browzey runs this — and hundreds of other browser tasks — in plain English. No copy-paste, no limit. Install the Chrome extension and try it yourself.
This tool converts XML (Extensible Markup Language) to JSON format. XML is commonly used for data interchange, configuration files, and web services, while JSON is preferred for modern APIs and JavaScript applications.
Input XML:
<person id="1"> <name>John</name> <age>30</age> </person>
Output JSON:
{
"person": {
"@_id": 1,
"name": "John",
"age": 30
}
}How does XML to JSON conversion work?
XML elements become JSON objects, attributes become properties prefixed with @, and text content becomes the value. Repeated elements become arrays.
Are XML attributes preserved?
Yes, XML attributes are preserved with an @_ prefix. For example, <item id='1'> becomes {'item': {'@_id': '1'}}.
What about XML namespaces?
Namespaces are preserved in the element names. You may need to process these in your application if namespace handling is required.
Can I convert large XML files?
The tool handles moderately sized XML files in the browser. For very large files, consider using a server-side solution or streaming parser.