XML to JSON Converter

Your data never leaves your browser — everything runs on your device.

How it maps: XML attributes become @name keys, repeated elements become arrays, and text inside an element with children becomes #text. In JSON to XML mode, use the same conventions in reverse.

Convert XML to JSON — or flip the direction and convert JSON back to XML — on one page. Attributes are kept with an @ prefix, repeated elements become arrays, and numbers and booleans are detected automatically. If your XML is broken, the error tells you the exact line and column instead of a vague message. Legacy SOAP responses, RSS feeds, and config files all convert cleanly. Free, no signup, and your data never leaves your browser.

Frequently asked questions

How are XML attributes represented in JSON?

Attributes use the @ prefix: <book id="bk101"> becomes {"book": {"@id": "bk101"}}. In JSON to XML mode, write "@id" in your JSON and it becomes an attribute again.

What happens to repeated elements?

Repeated sibling elements become a JSON array. Two <book> elements under <catalog> become "book": [{...}, {...}]. A single element stays a plain object — XML has no way to mark a one-item array.

How do I fix an XML error?

The error message gives the line and column where parsing stopped. Common causes are a mismatched closing tag, an unescaped & (write &amp; in XML text), or a missing closing tag.

Is my XML uploaded anywhere?

No. Conversion uses the browser DOMParser (which never fetches external entities, so there is no XXE risk) and runs entirely on your device. Your data is never sent to a server.