How do you convert XML to JSON?
To convert XML to JSON, paste the XML or upload a .xml or .txt file and click Convert. Each element becomes an object key, repeated sibling elements become an array, text content becomes a string, and element attributes are collected under an @attributes key. The conversion is parsed with the browser's own XML parser and reports invalid XML.
How are XML attributes handled in JSON?
XML attributes have no direct JSON equivalent, so they are placed in a nested @attributes object on the element they belong to. For example, <user id="7">Alice</user> becomes {"user": {"@attributes": {"id": "7"}}} alongside the text content. All values stay strings; numbers and booleans are not type-converted.
Runs in your browser. Your files and text never leave your device - nothing is uploaded.
