在瀏覽器中在 JSON 和 TOML 之間互相轉換,支援雙向轉換。
如何使用 JSON / TOML
選擇轉換方向:JSON 轉 TOML,或 TOML 轉 JSON。
貼上您的 JSON 或 TOML。
複製結果,或互換進行反向轉換。
This is a two-way converter between JSON and TOML. Pick a direction, paste your data, and copy the result. It is built on a well-tested TOML parser that handles nested tables and arrays of tables correctly.
Everything runs locally in your browser, so your data, which for config files can include hostnames or tokens, never leaves your device.
TOML (Tom's Obvious, Minimal Language) is a configuration format designed to be obvious to read and to map cleanly onto a hash table. It is what Rust's Cargo uses for Cargo.toml and what Python projects use for pyproject.toml, among many others.
JSON and TOML describe similar data but suit different jobs. JSON is the lingua franca for APIs and machine exchange. TOML is built for human-written config, with sections, comments and first-class dates that make a settings file pleasant to edit.
TOML also supports native date and time values and typed numbers, so values keep their meaning rather than all becoming strings, which is part of why it is preferred for configuration.
Most data round-trips cleanly, but there is one catch. TOML has no null value. JSON nulls cannot be represented, so remove or replace them before converting to TOML, otherwise the conversion cannot express them.
常見問題
TOML 是一種設計為易於閱讀的極簡設定格式,被 Cargo 和許多 Python 專案的 pyproject.toml 使用。
大多數資料可以。TOML 沒有 null,因此 JSON 的 null 值無法表示;轉換前請移除或替換它們。
不會。轉換完全在瀏覽器中執行,您的資料永遠不會離開裝置。
嵌入此工具
將此工具加入你自己的網站。複製下方的程式碼片段,它會自動保持最新。
<iframe src="https://monu.tools/embed/zh-Hant/json-toml-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相關工具