YAML 转 JSON 在线转换器

Free 免费 · 无需注册 · 数据不上传
Indent
Error
YAML
JSON
// JSON output

更多开发工具

YAML 格式化
格式化与验证
JSON→YAML
转 YAML 配置
TOML→JSON
转 JSON
CSV→JSON
转 JSON
XML→JSON
转 JSON
JSON 格式化
格式化、验证与压缩
时间戳
Unix ↔ 日期
URL 编码
百分比编码

为什么这是最好的 YAML 转 JSON 工具

完整 YAML 支持

Handles all common YAML features: mappings, sequences, block and flow styles, anchors & aliases, multi-line strings, and comments.

正确的类型推断

YAML booleans (true/false/yes/no), integers, floats, and null values are correctly mapped to their JSON equivalents.

语法高亮输出

JSON output is syntax-highlighted by key, value type, and structure, making it easy to inspect the converted result.

下载 JSON

Export the converted result as a .json file for use in APIs, databases, or any JavaScript/TypeScript application.

常见问题

What is the difference between YAML and JSON?

YAML uses indentation and is more human-readable, commonly used for config files (Kubernetes, Docker, GitHub Actions). JSON uses braces and quotes, making it ideal for APIs and data exchange. Both can represent the same data structures.

Does this handle YAML anchors and aliases?

Yes. YAML anchors (&name) and aliases (*name) are fully resolved during conversion. The resulting JSON will contain the expanded, dereferenced values.

Are YAML comments preserved in JSON?

No. JSON does not support comments, so YAML comments (lines starting with #) are stripped during conversion. Only data values are transferred to the JSON output.

深度指南
YAML & TOML 配置指南
Kubernetes、Docker、Rust & Python 配置
阅读指南