JSON 转 YAML 转换器 — Uttir
Skip to main content

JSON 转 YAML 转换器

将 JSON 转换为整洁的 YAML,或将 YAML 解码回 JSON。支持常见 JSON 结构的双向转换。

JSON 转 YAML 转换器 — YAML is a human-friendly data format that you will encounter in Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, Docker Compose files, and most modern configuration. This tool converts JSON to YAML and back, so you can paste JSON from an API response and get a YAML config ready to drop into a repo.

Conversion runs locally in your browser. No data is uploaded.

Was JSON 转 YAML 转换器 useful?

JSON 转 YAML 转换器是什么?

YAML is a human-friendly data format that you will encounter in Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, Docker Compose files, and most modern configuration. This tool converts JSON to YAML and back, so you can paste JSON from an API response and get a YAML config ready to drop into a repo.

Both directions preserve the data: objects map to mappings, arrays to sequences, and the common scalar types round-trip cleanly. Multi-line strings, anchors, and flow style are not supported — keep your input to the everyday JSON subset.

使用方法

  1. Choose direction

    Toggle between JSON → YAML and YAML → JSON.

  2. Paste your input

    The output updates as you type or paste.

  3. Copy the result

    One click to copy the converted text.

示例

Service manifest

A common Kubernetes-style service definition.

结果: apiVersion: v1 kind: Service metadata: name: web spec: ports: - port: 80 targetPort: 8080

Decoded back to JSON

Round-trip is lossless for plain JSON.

结果: {"apiVersion":"v1","kind":"Service",...}

常见问题

相关指南

相关工具

Last reviewed: 2026-11-21