XML to JSON Converter
Convert XML to JSON instantly online. Free XML to JSON converter with attribute support, nested elements, and proper array detection. No signup required.
Related Tools
JSON → YAML
Convert JSON to YAML format instantly. Supports nested objects, arrays, and complex structures.
YAML → JSON
Convert YAML to JSON format instantly. Supports multi-document YAML and complex configurations.
CSV → JSON
Convert CSV to JSON array instantly. Automatic header detection and type inference.
Advertisement
How to Use the XML to JSON Converter
- Paste your XML in the left panel.
- The JSON output appears automatically as you type.
- Click "Copy Output" to copy the JSON to your clipboard.
- Use "Load Example" to see a sample XML bookstore document.
- Click "Download" to save the result as a
.jsonfile.
Conversion Rules
- XML attributes are prefixed with
@(e.g.,@id,@lang). - Text content is returned as a plain string if the element has no attributes or children.
- Repeated sibling elements with the same tag name become a JSON array.
- Mixed content (attributes + text) uses a
#textkey for the text value.