XML to JSON
Convert XML to JSON instantly — attributes, namespaces, and nested nodes handled, with compact or verbose output.
Your Data Never Leaves Your Device
Every tool runs entirely in your browser. Nothing you type is uploaded, stored, or logged on our servers.
Convert XML to JSON instantly in your browser. Paste XML payloads, feeds, or config files on the left and get JSON output on the right — in real time, with attributes and nested elements preserved.
Compact mode gives you clean, readable JSON, at the cost of dropping comments and CDATA markers. Verbose mode preserves the full XML structure as an elements tree, so it round-trips back to XML losslessly through the JSON to XML converter. Everything runs locally — nothing is uploaded.
FAQ
In compact mode, attributes are grouped under an `_attributes` key and text content under `_text`, following the widely-used xml-js convention. In verbose mode, each element is its own object with `type`, `name`, `attributes`, and a nested `elements` array — more verbose, but it preserves the full document structure including comments and CDATA sections.
Verbose mode does: converting XML to JSON and back with the JSON to XML converter reproduces the original structure, comments and CDATA included. Compact mode is honest about the trade-off — it produces cleaner, more readable JSON, but drops comments and some structural markers, so it doesn't round-trip perfectly.
Yes. Paste any well-formed XML payload, feed, or SOAP envelope and get JSON output, with attributes and nested elements preserved.
No. Parsing runs entirely in your browser, so sensitive payloads and internal schemas never leave your machine.
The converter validates well-formedness before converting and reports the error with its line and column number, so you can find and fix the exact spot.