← Back to File & Data Tools
Checking tool availability…
XML to JSON processes files locally in your browser.
Convert XML to JSON online
Map XML elements, attributes, and repeated siblings into formatted JSON without uploading. Choose a file or paste XML, review the preview, then convert and copy or download.
Your XML is processed locally in your browser and is not uploaded to our servers.
How to convert
- Upload an .xml file or switch to Paste XML.
- Review the JSON preview produced by the deterministic mapping rules.
- Select Convert to JSON, then copy or download the .json file.
Deterministic XML-to-JSON mapping
- Attributes are stored under @attributes.
- Element text is stored under #text when the element also has attributes or child elements; otherwise a text-only element becomes a JSON string.
- Repeated sibling element names become arrays; a single sibling stays a normal value.
- Empty elements become empty strings. Comments and processing instructions are ignored.
- Namespace prefixes are preserved via the DOM nodeName (for example ns:tag).
Private processing
Your XML is processed locally in your browser and is not uploaded to our servers, whether you choose a file or paste text. Parsing reuses the shared XML security module: DOCTYPE declarations are rejected, only UTF-8 is accepted, and nesting deeper than 50 levels is refused. There is no Looty Tools conversion endpoint that receives your XML contents for this workflow.
Limits and important notes
- Maximum XML size is 25.0 MB, whether uploaded or pasted.
- Maximum nesting depth is 50 levels.
- DOCTYPE / DTD documents are not supported.
- Only UTF-8 encoded XML is accepted.
- Only one XML input can be converted at a time.
Related tools
XML to JSON FAQ
- How do I convert XML to JSON?
- Open XML to JSON, upload an .xml file or paste XML, review the JSON preview, convert, then copy or download the .json file.
- Is my XML uploaded?
- No. Your XML is processed locally in your browser and is not uploaded to our servers.
- How are attributes mapped?
- Attributes are stored under @attributes. When an element also has children or attributes, its text is stored under #text.
- What happens to repeated sibling elements?
- Repeated sibling names become JSON arrays. A single sibling stays a normal object or string value.
- Are DOCTYPE declarations supported?
- No. Documents with a DOCTYPE or DTD are rejected for safety. Only UTF-8 XML up to 50 levels deep is accepted.
- How are namespaces handled?
- Element keys use the DOM nodeName, which preserves namespace prefixes such as ns:tag. Namespace declarations appear under @attributes when present.