YAML 輸入
JSON
無資料
關於此工具
YAML 檢視器是現代 DevOps、雲端基礎架構與應用程式開發中,處理 YAML 設定檔不可或缺的工具。我每天都會用它來偵錯 Kubernetes manifests、Docker Compose、GitHub Actions 工作流程、Ansible playbooks 及各種設定檔。互動式樹狀圖讓你能一目了然地理解複雜的巢狀結構——可展開/收合節點,聚焦特定區塊,清楚看到資料型別(字串、數字、布林、陣列、物件),並能快速瀏覽大型 YAML 檔而不會迷失在縮排中。JSON 轉換功能非常適合驗證 YAML 語法,並預覽資料將如何被解析器解讀。語法驗證能在部署前即時捕捉錯誤——遺漏的冒號、縮排錯誤、無效的錨點或格式錯誤的陣列都會以精確的行與列號標示出來。
使用方式
將你的 YAML 內容貼上或上傳到輸入面板,工具會即時自動解析並驗證 YAML。使用檢視模式分頁切換:樹狀圖(互動式階層視覺化)、JSON(檢視 YAML 轉換成 JSON 格式)、YAML(格式化並驗證過的 YAML 輸出)。在樹狀圖模式下,點擊任一節點可展開/收合巢狀結構——大型檔案可用「全部展開」和「全部收合」快速導覽。任何語法錯誤都會以詳細錯誤訊息(含行與列號)明顯顯示。你可直接上傳 YAML 檔(支援 .yaml、.yml、.txt 副檔名),檔名會顯示於畫面供參考。可將 JSON 或格式化後的 YAML 輸出複製到剪貼簿,或下載轉換後的資料。
常見使用情境
Kubernetes Debugging
Paste complex K8s deployment YAML and use tree view to verify nested spec.containers.env variables, volume mounts, or resource limits structure.
Docker Compose Validation
Check docker-compose.yml syntax before running 'docker-compose up'—catch indentation errors or invalid service configurations.
GitHub Actions Review
Visualize complex workflow YAML with multiple jobs and conditional steps in an easy-to-navigate tree structure.
Config File Analysis
Parse large application configuration files (Helm charts, Ansible playbooks, OpenAPI specs) to understand the structure without reading hundreds of lines.
YAML to JSON Conversion
Convert YAML config to JSON for use with tools that only accept JSON input (many APIs and CLI tools).
Learning YAML
Use the tree view to understand how YAML indentation maps to nested data structures and how YAML anchors/aliases work.
限制與重要提示
Very large YAML files (>5MB) may cause browser performance issues—for massive files, use command-line tools like yq or yaml-lint. The tool uses JavaScript YAML parser which follows YAML 1.2 spec—some YAML 1.1 features may parse differently. Custom YAML tags (!include, !env, !ref) are not supported as these are preprocessor features requiring external file access. Comments in YAML are preserved in the input display but not included in JSON/tree output (JSON doesn't support comments). For Kubernetes-specific validation (CRD schemas, API versions), use kubectl --dry-run instead. Multi-document YAML files (separated by ---) show only the first document—split multi-doc files for individual viewing. Binary data in YAML (base64 encoded) is shown as-is without decoding.