使用方式
先完成一次順手的操作
- 將 YAML 或 JSON 貼到左側輸入欄。
- 用中間的 ⇄ 切換轉換方向(YAML → JSON 或 JSON → YAML)。
- 點「轉換」查看結果,解析失敗會在輸入下方顯示行號提示。
YAML 與 JSON 雙向即時互轉,純前端解析,支援巢狀結構與多行區塊。 Two-way YAML ↔ JSON conversion in your browser — nested structures, multiline blocks, and inline line-number errors.
輸入
YAML
YAML → JSON
輸出
JSON
JSON 是 YAML 的子集——這表示每份合法的 JSON 同時也是合法的 YAML。這個工具使用打包的 js-yaml(MIT 授權)在瀏覽器本機解析 YAML,再以 JSON.stringify 或 yaml.dump 序列化輸出,沒有任何資料傳送至外部伺服器。
JSON is a subset of YAML — meaning every valid JSON file is also valid YAML. This tool uses the bundled js-yaml library (MIT) to parse YAML locally in your browser, then serializes output via JSON.stringify or yaml.dump. No data leaves your device.
解析器使用 js-yaml 的 load()(安全模式)與 dump(),支援巢狀 map 與序列、引號字串、多行區塊(literal | 與 folded >)、null、boolean、數字,以及基本的錨點(&name)與別名(*name)。解析失敗時會顯示行號與欄位,而非空白輸出。
The parser uses js-yaml's load() (safe mode) and dump(), handling nested maps and sequences, quoted strings, multiline literal (|) and folded (>) blocks, null, boolean, numbers, and basic anchors (&name) and aliases (*name). Parse failures show a line/column hint instead of a blank panel.
不支援範圍:YAML 1.1 複雜 merge key 解析、JSON Schema / YAML Schema 驗證、大型檔案串流(建議 500 KB 以下)、檔案上傳,以及 TOML、XML 等其他格式。 Out of scope: complex YAML 1.1 merge-key resolution, JSON Schema or YAML Schema validation, large-file streaming (keep under ~500 KB), file upload, and other formats like TOML or XML.
快速導覽
把需要的說明放在工具下方,讓第一次使用與之後回來複用都更順。
英文搜尋: yaml to json、json to yaml、yaml json converter、convert yaml to json、convert json to yaml、yaml json online
使用方式
常見情境
常見問題
不會。所有解析與轉換都在瀏覽器本機以打包的 js-yaml(MIT 授權)與原生 JSON 解析器完成,不傳送任何資料到外部。
No. All parsing and conversion happen locally using the bundled js-yaml (MIT) library and the native JSON parser. Nothing is sent to any server.
支援。可處理巢狀 map、序列、引號字串、多行區塊(literal | 與 folded >)、null、boolean 與數字等常見 YAML 結構。
Yes. It handles nested maps, sequences, quoted strings, multiline literal (|) and folded (>) blocks, null, boolean, and number scalars.
輸出面板會清空,並在輸入框下方顯示一行錯誤訊息,包含解析器提供的行/列位置與白話提示,而非只給一個空白結果。
The output panel clears and an inline message appears below the input with the parser's line/column (when available) plus a plain-language hint — never a silent blank result.
支援基本的錨點(&)與別名(*)展開,並提供「Anchor Resolution Trail」面板顯示每個錨點被引用的位置。複雜的 YAML 1.1 merge key 解析不在範圍內。
Quick guide
Compact below-tool notes that help first-run users and repeated visitors move faster without changing the main interface.
Chinese search: YAML 轉 JSON、JSON 轉 YAML、YAML JSON 轉換、YAML 轉換器、線上 YAML 轉 JSON
How to use
Examples
FAQ
No. All parsing and conversion happen locally using the bundled js-yaml (MIT) library and the native JSON parser. Nothing is sent to any server.
Yes. It handles nested maps, sequences, quoted strings, multiline literal (|) and folded (>) blocks, null, boolean, and number scalars.
The output panel clears and an inline message appears below the input with the parser's line/column (when available) plus a plain-language hint — never a silent blank result.
Basic anchors (&) and aliases (*) are expanded, and an Anchor Resolution Trail panel lists each anchor and where it was referenced. Complex YAML 1.1 merge-key resolution is out of scope.