XML to JSON Converter
Two-way XML ↔ JSON conversion using your browser's native XML parser.
Convert XML to JSON or JSON to XML without leaving your browser. Attributes are preserved with the @ prefix, repeated child elements collapse into arrays, and the inverse direction reconstructs valid XML from a JSON tree.
Common use cases
- Migrate XML responses from a legacy API into a modern JSON pipeline
- Generate JSON fixtures from XML samples in vendor docs
- Inspect SOAP envelopes as readable JSON during debugging
- Round-trip JSON config to XML when integrating with Java/.NET tools
Frequently asked questions
How are XML attributes represented?▾
Attributes become JSON keys prefixed with @. For example <a href="x"/> becomes {"a": {"@href": "x"}}.
What about repeated elements?▾
When the same child element appears more than once, the converter promotes them to a JSON array automatically.
Is the conversion lossless?▾
For common cases yes. Mixed text-and-element content and processing instructions are best-effort and may not round-trip exactly.
Related tools
{}
JSON Formatter & Validator
Beautify, validate and minify JSON instantly in your browser.
↔
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
B64
Base64 Encoder & Decoder
Encode and decode Base64 strings, including UTF-8 and binary.
%
URL Encoder & Decoder
Percent-encode and decode URL components safely.