XML 轉 JSON 工具
將 XML 文件轉換為 JSON。屬性會轉換為帶 @ 前綴的鍵;重複的標籤會轉換為陣列。
如何使用本工具
- 1
Paste or type your XML into the input box.
- 2
Read the converted JSON in the output panel below, which updates as you type.
- 3
If the XML is malformed, fix the error shown in red and the output will reappear.
- 4
Select the JSON from the output panel to copy it into your project.
什麼是 XML 轉 JSON 工具?
從 XML 轉換到 JSON 在某些方面會有資訊損失:XML 支援命名空間、處理指令和 CDATA 節,而這些在 JSON 中沒有直接的對應物。本轉換工具能處理 90% 的情況:巢狀元素、屬性(帶 @ 前綴)和文字內容(#text)。對於複雜的 XML,可能需要使用專門的函式庫。
常見使用場景
Inspect a SOAP or legacy XML API response as JSON before wiring it into a JavaScript front end.
Convert an RSS or Atom feed snippet into JSON to prototype a parser quickly.
Turn a config file or build manifest written in XML into JSON to eyeball its structure.
Pull values out of an XML sitemap or data export when a JSON shape is easier to traverse.
Teach or learn how attributes, repeated tags, and text nodes map between the two formats.
Sanity-check that a small XML payload is well-formed, since malformed input shows a parser error.
常見問題
@ 前綴是什麼意思?▼
相關工具
JWT 解碼器
即時解碼 JSON Web Token(JWT)。完全在你的瀏覽器中執行:權杖絕不會離開你的裝置,可安全用於正式環境的密鑰。
JSON格式化與驗證工具
線上格式化、驗證和壓縮JSON。完全在你的瀏覽器中執行:你的資料永遠不會離開你的裝置。
XML 格式化工具
格式化並美化 XML 文件。適用於 SOAP、網站地圖、RSS 訂閱源和設定檔。
Base64 編碼與解碼工具
將字串編碼為 Base64,或將 Base64 解碼為文字。尊重你的隱私:全部在你的瀏覽器中執行。
URL 編碼與解碼工具
將文字轉換為 URL 安全的編碼(百分號編碼),或進行反向轉換。適用於查詢字串、重新導向和 OAuth 流程。
HTML實體編碼與解碼工具
將特殊字元轉換為HTML實體(&、<等),或進行反向轉換。適用於將文字安全地嵌入HTML。