XML to JSON Converter
Convert XML to JSON format using DOMParser. Handles nested elements, attributes, and text nodes.
5 of 5 uses remaining today
Zenovay
Privacy-first analytics for your website
Understand your visitors without invasive tracking. GDPR compliant, lightweight, and powerful.
Related Tools
Color ConverterConvert colors between HEX, RGB, HSL, and CMYK formats. Live preview with color picker.
Unit ConverterConvert between units of length, weight, temperature, area, volume, speed, and more.
Number Base ConverterConvert numbers between binary, octal, decimal, and hexadecimal bases.
Unix Timestamp ConverterConvert between Unix timestamps and human-readable dates. Show ISO 8601, UTC, local time, and relative time.
Frequently Asked Questions
How are XML attributes handled?▾
XML attributes are stored under an "@attributes" key in the JSON object. For example, <item id="1"> becomes {"@attributes": {"id": "1"}}.
How are text nodes handled?▾
If an element has both attributes/children and text content, the text is stored under a "#text" key. If an element only has text content and no attributes, it becomes a simple string value.
Does this tool support namespaces?▾
Namespace prefixes are preserved in the tag names (e.g., "soap:Envelope"). Namespace declarations (xmlns) appear as attributes.
Can I convert JSON back to XML?▾
This tool currently only supports XML-to-JSON conversion. For JSON-to-XML, the mapping is ambiguous since JSON does not distinguish between attributes and elements.