XML to JSON Converter
Convert XML to JSON format. Handles attributes, namespaces, CDATA sections, and nested elements. Download the converted JSON file.
JSON output will appear here
How to Use XML to JSON Converter
- Paste your XML data into the input area or upload an .xml file.
- The tool will parse your XML and convert it to JSON format.
- Attributes are prefixed with '@' in the JSON output.
- Text content is stored in a '#text' property when mixed with attributes.
- Copy the JSON output or download it as a .json file.
Frequently Asked Questions
How are XML attributes handled?
XML attributes are converted to JSON properties prefixed with '@'. For example, <item id="1"> becomes {"@id": "1"} in JSON.
What happens with CDATA sections?
CDATA sections are treated as text content. If the element also has attributes, the text is stored in a '#text' property.
Can I convert JSON back to XML?
This tool focuses on XML to JSON conversion. For JSON to XML, you would need a dedicated converter.
How are repeated XML elements handled?
When multiple sibling elements share the same tag name, they are automatically converted into a JSON array.