XML to JSON

Parse XML into JSON for debugging, scripting, and modern APIs. Attributes are preserved with a special prefix. Repeated elements may become arrays.

Result

Paste XML, then Convert.

How to convert XML to JSON

  1. Paste an XML document or fragment.
  2. Click Convert.
  3. Attributes appear on JSON objects with an @_ prefix.
  4. Copy or download the formatted JSON. Fix malformed tags if the parser reports an error.

FAQ

Attributes are included on JSON objects with an @_ prefix on the attribute name, matching common XML-to-JSON conventions.
Yes. Paste the XML body. Large responses should stay under the 5 MB input limit.
Not always. XML and JSON model data differently — arrays, attributes, and null are the main differences.
No. Parsing runs in your browser.
Repeated XML elements with the same tag name become arrays. Mixed text and child elements may produce both #text and nested properties — inspect the structure before feeding it to strict parsers.

Related tools