JSON ↔ XML Converter
Live 2-way converter between JSON and XML. Configurable attribute prefix and text node key. 100% browser-based, no upload.
You might also like
😄 Free thanks to ads
JSON ↔ XML Converter
JSON and XML have different structures, so conversion has a few choices. This tool converts both ways in real time, with two tweakable rules.
Two options
- Attribute prefix (default
@_) — prefix used in JSON keys for XML attributes. Example:<book id="1">→{"@_id": "1"} - Text key (default
#text) — JSON key holding the text content of an element when it also has attributes. Example:<title lang="en">Gatsby</title>→{"title": {"@_lang": "en", "#text": "Gatsby"}}
How to use
- Type in either side — the other converts automatically
- Sample button loads example data
- Swap button exchanges left and right
- Copy or download each format separately
Conversion rules
- Arrays — multiple child elements with the same name become a JSON array
- Attributes vs child elements — distinguished by the prefix
- Empty elements —
<br />→{"br": ""} - Comments — stripped during conversion (not lossless)
Client-side only
Your data never leaves the browser. Safe for SOAP responses, API keys, internal configs.
Related tools
More iTool Features!
Character Counter
Free online character counter — count characters, words, sentences, and bytes in real time. No install, no signup.
JSON Parser / Formatter
Free online JSON parser. Validate, pretty-print, and minify JSON in real time with syntax highlighting and error location. 100% client-side.
YAML ↔ JSON ↔ TOML Converter
Live 3-way converter between YAML, JSON, and TOML. Smart schema detection for Kubernetes, Docker Compose, GitHub Actions, plus YAML pitfall warnings (Norway problem, octal, sexagesimal). 100% browser-based.
XML Parser / Formatter
Free online XML parser with real-time validation, collapsible tree view (+/-), pretty print, and syntax highlighting for elements, attributes, text, and CDATA. 100% browser-based.
Text Diff
Free online text diff tool — compare two texts side by side and spot every difference instantly. No install, no signup.