XML to JSON Converter
Convert XML to JSON and JSON back to XML in one place. Free, fast, and everything runs on your device.
@ (e.g. @id);
element text becomes #text when the element also has attributes or child elements, otherwise the value is a plain string;
repeated child elements with the same name become a JSON array.
The same rules apply in reverse for JSON → XML.
XML Input
JSON Output
How to use the XML to JSON Converter
- Choose a direction with the tabs — XML → JSON or JSON → XML.
- Paste your XML or JSON into the input box on the left.
- Click Convert to get pretty-printed output, or a clear error message with a line hint if something's off.
- Copy the result to your clipboard or download it as a file.
Why use ZillaKit's XML to JSON converter?
Moving data between XML and JSON usually means fighting over how attributes, text nodes, and repeated tags should map. This tool uses a clear, documented convention: attributes are prefixed with @, mixed text is stored as #text, and repeated elements collapse into arrays — and it applies the same rules in reverse so a round trip stays faithful. Parsing uses the browser's native DOMParser for correct, standards-based XML handling, and the JSON side uses the built-in parser, so you get real error messages with line hints instead of silent failures. Everything runs locally in your browser with no signup and nothing uploaded, which keeps configuration files, API payloads, and exported data completely private. Output is pretty-printed and ready to copy or download. It's ideal for developers wrangling API responses, config files, and legacy XML feeds.
FAQ
How are XML attributes represented in JSON?
Each attribute becomes a key prefixed with @. For example, <item id="7"> becomes {"item": {"@id": "7"}}.
What happens to repeated elements?
When an element appears more than once inside its parent, those elements are grouped into a JSON array under a single key, preserving their order.
Does it handle text mixed with attributes?
Yes. If an element has attributes or child elements as well as text, the text is stored under the #text key. Text-only elements without attributes become plain strings.
Is my data uploaded anywhere?
No. All parsing and conversion happens locally in your browser. Your data never leaves your device.