XML to JSON converter — preserves attributes, nested elements, CDATA. Reversible.
- Runs locally
- Category Format Converter
- Best for Turning pasted content or local files into a handoff-friendly format.
What this tool does
Free online XML ⇄ JSON converter that actually round-trips. Paste XML and get JSON where every attribute lives under `@attrs`, every text node under `#text`, every CDATA block under `#cdata`, and same-name siblings collapse into proper arrays. Paste JSON back and you get the original XML — same element order, same nesting, same attribute spelling. Three tunable knobs: attribute prefix (`@` / `_` / custom), text node name (`#text` / `$t`), and force-array-always for downstream code that hates polymorphic shapes. 100% client-side parsing via the browser's native DOMParser — your SOAP responses, Maven POMs, RSS feeds, and Android manifests never leave the tab.
Tool details
- Input
- Text + Numbers + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- No account required
- Open the page and use it; whether results survive refresh depends on the tool.
- Performance budget
- Initial JS <= 18 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Format Converter · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How XML ⇄ JSON Converter fits into your work
Use it when the main problem is getting content from one practical format into another.
Conversion jobs
- Turning pasted content or local files into a handoff-friendly format.
- Previewing a conversion before you use it in a larger workflow.
- Cleaning small format mismatches without opening a full editor.
Conversion checks
- Try a small sample first when the source format is messy.
- Check character encoding, separators, and line endings after conversion.
- Keep the source until the converted output has been reviewed.
Good next steps
These links move the current task into a more complete workflow.
- 1 JSON to YAML Converter Convert JSON to clean YAML — block scalars for multiline strings, optional key sorting, 2/4-space indent, line-numbered errors — browser-only Open
- 2 JSON to XML Converter Convert JSON to clean, indented XML — @attr/#text conventions, custom root, escaped output. Browser-only. Open
- 3 XML Formatter & Validator Pretty-print, minify, and validate XML in your browser — preserves CDATA, comments, and namespaces. Open
Real-world use cases
Turn a SOAP response into typed JSON
Copy a SOAP envelope out of DevTools, paste it in, and read the body as JSON. The soap prefix stays in the key, attributes sit under an attrs key, and turning on Always array stops single rows from breaking the TypeScript types you generate from the output.
Edit an RSS feed, then write it back
Convert an RSS or Atom feed to JSON, tweak titles or links by hand, then paste the JSON back to rebuild the XML. Repeated item tags stay as an array and CDATA content survives under a cdata key, so the feed structure comes out intact.
Common pitfalls
Expecting XML comments back after a round-trip: they are dropped because JSON has no comment node.
Forgetting to enable Always array when a single child silently becomes a scalar instead of a one-item array.
Setting the attribute prefix but reading output as if attributes were still nested under the default attrs key.
Privacy
All parsing runs in your browser through the native DOMParser. Your XML and JSON, including SOAP responses, POM files, and Android manifests, never leave the tab and nothing is uploaded to any server.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only