Skip to main content
File & Data Conversion Tools

XML to JSON Converter

Convert XML to JSON - nested elements become nested objects, attributes are preserved, repeated elements become arrays.

Paste or upload XML below - this tool parses it with your browser's built-in, safe XML parser and converts the structure to JSON.

External entities and DTD-based network requests are never resolved by this tool - browser XML parsing is inherently safe against XXE-style attacks by default.

How the Conversion Works

Each XML element becomes a JSON object key; attributes are captured under an @attributes key; repeated sibling elements with the same name become a JSON array; an element's plain text content becomes its value (or a #text key when the element also has attributes/children).

How to Use It

  1. Paste or upload XML data.
  2. Click Convert.
  3. Copy or download the resulting JSON.

Security Notes

XML parsing here uses the browser's native DOMParser, which does not fetch external DTDs or resolve external entities - your XML is never used to make outbound network requests, protecting against XXE-style attacks.

Share this tool: