XML to JSON Converter — Fast Browser-Based XML Parsing & Output
Convert XML to JSON in your browser. Native DOMParser with configurable attribute prefix, text key, and compact mode.
Cách dùng
- 1 Paste valid XML. The browser parses it with the native DOMParser.
- 2 Choose attribute prefix (default `@`) and text key (default `#text`).
- 3 Toggle Compact to collapse leaf elements (no attrs, no children) to plain strings.
- 4 Copy or download the JSON tree.
Vì sao dùng công cụ này
- Native DOMParser — no external XML library bundled.
- Attributes become keys prefixed with `@`. Mixed text + children stored under `#text` key.
- Repeated child tags collapse into arrays automatically.
- Pure client-side — your data stays in your browser.
Câu hỏi thường gặp
How are attributes represented?
Each attribute becomes a key prefixed with `@` (configurable). `<note to="Tove">` becomes `{"@to": "Tove"}`.
What if a tag repeats inside its parent?
Repeated children with the same tag name collapse into a JSON array.
How is mixed content handled?
Text content sits next to children under the `#text` key (configurable).
Need to go the other way?
See <a class="text-brand-600 hover:underline" href="/json-to-xml">JSON to XML</a>, or <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a> for pretty-print only. JSON output works directly with <a class="text-brand-600 hover:underline" href="/json-formatter">JSON Formatter</a>.
XML to JSON Converter là gì?
An XML to JSON Converter is a tool that transforms XML markup into equivalent JSON data, mapping elements, attributes, and text content into nested objects and keys. It runs in the browser using the native DOMParser, with configurable options including an attribute prefix, a dedicated text key, and a compact output mode for cleaner, more concise results.
XML to JSON Converter là công cụ lập trình miễn phí của Zerethon Tools. Convert XML to JSON in your browser. Native DOMParser with configurable attribute prefix, text key, and compact mode. Chạy hoàn toàn trong trình duyệt — không đăng ký, không tải lên.
- Danh mục
- Lập trình
- Giá
- Miễn phí
- Quyền riêng tư
- Chạy trên trình duyệt
- Đăng ký
- Không cần
Quyền riêng tư
Dữ liệu của bạn không bao giờ rời khỏi trình duyệt trừ khi được nêu rõ. XML to JSON Converter chạy hoàn toàn phía client — không tải lên máy chủ, không ghi log, không theo dõi dữ liệu bạn nhập.
So sánh
Kiến thức cơ bản
Hướng dẫn
Công cụ liên quan
JSON Formatter
Format, validate, and minify JSON online. Free, no signup — your data never leaves your browser.
Mở công cụSQL Formatter
Format SQL queries online — beautify MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and BigQuery.
Mở công cụUUID Generator
Generate UUIDs online — v1, v4, v7, and Nil. Bulk generation up to 10,000. Free, no signup.
Mở công cụPassword Generator
Generate strong, cryptographically random passwords. Configurable length and character sets — runs in your browser.
Mở công cụBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.