All tools

XML ↔ JSON Converter

Convert between XML and JSON, in either direction.

Runs locally in your browser

About this tool

Paste an XML document to get its JSON equivalent, with attributes mapped to @-prefixed keys and text content to #text, or go the other way from a single-root JSON object back to XML.

Conversion runs entirely in your browser using the native DOMParser, so nothing you paste is sent anywhere.

Frequently asked questions

Each attribute becomes a key prefixed with @ (e.g. <user id="1"> becomes "@id": "1"), and element text content becomes a #text key when the element also has attributes or children.