XML to JSON
Translate XML into JSON, preserving attributes, text content and element hierarchy, and convert JSON back into well-formed XML. Control the attribute prefix and text-node name, force specific tags to always be arrays, strip namespace prefixes, keep comments and CDATA, and coerce numbers and booleans. Malformed XML is reported with the line and column.
Output will appear here…
Repeated sibling elements become arrays; a single child becomes an object unless listed under "Always arrays". Mixed content keeps text under the text-node key.
Related tools
JSON to YAML
Convert JSON into clean YAML with control over quoting, wrapping, anchors and multi-document output.
YAML to JSON
Convert YAML into strict JSON, with multi-document streams, YAML-only types and duplicate keys handled.
TOML to JSON
Convert TOML config to JSON and JSON back to TOML, with Cargo, pyproject and netlify presets.
How to use XML to JSON
- 1Choose the direction: XML → JSON or JSON → XML. Swap reverses it using the current output as input.
- 2Paste or upload the document; errors point at the line and column.
- 3Set the attribute prefix and text-node name, and list any tags that must always become arrays.
- 4For JSON → XML, set the root element name and whether to add the XML declaration, then copy or download.
About XML to JSON
Translate XML into JSON, preserving attributes, text content and element hierarchy, and convert JSON back into well-formed XML. Control the attribute prefix and text-node name, force specific tags to always be arrays, strip namespace prefixes, keep comments and CDATA, and coerce numbers and booleans. Malformed XML is reported with the line and column.
XML to JSON is part of FizzKit — a collection of focused developer and ad-tech tools. Because everything runs locally, it works offline once loaded and never exposes your data to a remote server.