在瀏覽器中在 JSON 和 XML 之間互相轉換,支援雙向轉換。
如何使用 JSON / XML
選擇轉換方向:JSON 轉 XML,或 XML 轉 JSON。
貼上您的 JSON 或 XML。
複製轉換結果,或互換進行反向轉換。
A two-way converter between JSON and XML, built on a well-tested parser. Convert a JSON object into XML or parse XML back into JSON, preserving attributes and turning repeated elements into arrays and back again.
It is handy whenever you need to bridge an XML-based system and a JSON-based one, inspect a SOAP payload as readable JSON, or turn a JSON config into the XML a legacy tool expects.
Everything runs locally in your browser, so your data never leaves your device.
XML (Extensible Markup Language) is a long-established way to structure data with nested tags and attributes. It is still everywhere: SOAP web services, RSS and Atom feeds, office document formats, Android layouts and countless configuration and data-exchange formats.
Attributes are preserved across the round trip using an @_ prefix on the JSON side, so an XML attribute becomes a clearly marked JSON key and converts back into the same attribute, rather than being lost or confused with child elements.
Repeated elements map naturally to arrays: several <item> tags under a parent become a JSON array, and a JSON array becomes repeated elements in the XML, which is the shape most real documents take.
常見問題
屬性在 JSON 端使用 @_ 前綴保留,因此來回轉換時屬性完整保留。
重複的 XML 元素成為 JSON 陣列,JSON 中的陣列在 XML 中成為重複元素。
不會。轉換完全在瀏覽器中執行,您的資料永遠不會離開裝置。
嵌入此工具
將此工具加入你自己的網站。複製下方的程式碼片段,它會自動保持最新。
<iframe src="https://monu.tools/embed/zh-Hant/json-xml-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相關工具