XML ↔ JSON Converter
Free online XML and JSON converter tool
Converting Between XML and JSON
XML uses tags and attributes for structure. JSON uses objects and arrays. This tool converts between both formats, handling nested elements, attributes, and text content. XML attributes are mapped to JSON keys, and child elements become nested objects.
How to Convert XML to JSON and Back
Paste XML and click XML → JSON to get the equivalent JSON structure. Paste JSON and click JSON → XML for the reverse. The conversion handles nested elements, attributes, and mixed content.
▶How are XML attributes handled in JSON?
XML attributes are typically prefixed with @ in the JSON output (e.g., @id for id attribute). Text content is stored in a #text key when attributes are present.
▶Can I convert SOAP XML to JSON?
Yes, the tool handles any well-formed XML including SOAP envelopes, RSS feeds, SVG, and custom XML schemas.
▶Is the conversion lossless?
The conversion preserves data but may change the structure slightly to accommodate format differences (e.g., XML attributes become JSON keys). Comments and processing instructions are not preserved.