📄

XML ↔ JSON Converter

Convert XML to JSON or JSON to XML instantly. Handles attributes, arrays, and deeply nested structures.

XML
JSON
Advertisement
How to use
  1. Paste XML into the left pane — the equivalent JSON appears on the right automatically.
  2. Use the swap button (⇄) to switch direction and convert JSON back into XML.
  3. Click Copy above either pane to copy the result to your clipboard.
FAQ

Attributes are grouped under an @attributes key on the element's JSON object. Mixed text content lives under #text. This preserves the original XML structure during round-trips.

When a parent contains multiple children with the same tag name, the converter automatically collects them into a JSON array — so <book> repeated three times becomes a 3-element array.

No. Parsing uses the browser's built-in DOMParser. Your XML and JSON never leave your device.