XML to JSON Converter
Convert XML to JSON and JSON to XML online. Free bidirectional XML JSON converter with attribute support and pretty printing.
Input (XML)
Output (JSON)
Frequently Asked Questions
How do I convert XML to JSON?▾
Paste your XML content into the input field and click Convert. The tool parses the XML including attributes (prefixed with @_) and outputs formatted JSON. Switch the direction to convert JSON back to XML.
How are XML attributes handled in the conversion?▾
XML attributes are preserved in the JSON output with an @_ prefix. For example, <person id="1"> becomes { "person": { "@_id": "1" } }. This ensures no data is lost during conversion.
What is the difference between XML and JSON?▾
XML is a markup language that uses tags and attributes, supports comments and namespaces, and is more verbose. JSON is lighter, easier to parse in JavaScript, and more commonly used in modern REST APIs. XML is still common in enterprise systems (SOAP, WSDL), configuration files, and document formats.
Can I convert a large XML file?▾
Yes. The tool processes XML entirely in your browser so there are no file size limits imposed by a server. Very large files may take a moment to process depending on your device.