Loading tool…
Loading tool…
Convert XML to JSON instantly in your browser.
Was this tool useful?
Does this XML to JSON tool upload my data?
No. All XML parsing and JSON generation happens entirely in your browser using DOMParser. Nothing is sent to any server.
Why is my XML showing an 'Invalid XML' error?
This occurs when the XML contains syntax errors or unclosed tags. The DOMParser returns a parsererror node, which the tool detects and reports.
How are XML attributes handled?
If enabled, attributes are included under an `_attributes` object. Otherwise, they are ignored to keep the JSON clean.
How are repeated XML tags represented?
Repeated sibling tags are converted into arrays in the JSON result.
Why does my text-only element return a string instead of an object?
If a tag contains only text (and optional attributes), it becomes a plain string for simplicity, unless attributes are present.
Can I upload an XML file instead of pasting?
Yes. The tool supports uploading .xml files and reads them locally using FileReader.
Can I format JSON output with custom indentation?
Yes. You can choose between 2 or 4 spaces in the Advanced Settings.