Đi tới nội dung

Định dạng và kiểm tra YAML / JSON

Kiểm tra, định dạng và chuyển đổi YAML ↔ JSON. Chạy hoàn toàn trên trình duyệt.

Chạy cục bộ trên trình duyệt

input detected as:yaml
// input
// output
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": {
    "name": "web"
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "matchLabels": {
        "app": "web"
      }
    },
    "template": {
      "metadata": {
        "labels": {
          "app": "web"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "app",
            "image": "nginx:1.27-alpine",
            "resources": {
              "requests": {
                "cpu": "100m",
                "memory": "128Mi"
              },
              "limits": {
                "memory": "256Mi"
              }
            }
          }
        ]
      }
    }
  }
}

Cách hoạt động

When to reach for this

  • Debugging Helm values: paste the rendered template YAML, convert to JSON to see the structure clearly.
  • Cleaning up an API response: pretty-print JSON from a curl command or paste into YAML for readable diffs.
  • Catching syntax errors fast: the linter surfaces the exact position of an unclosed quote or misaligned indent.
  • Converting a quick config: e.g., take a JSON file generated by a script and hand it to a YAML-only tool.

About the round-trip

YAML is a superset of JSON in intent but not 1:1. Multi-document YAML streams (---separators) can't be represented as a single JSON value. Anchors and merge keys are resolved during parsing; you won't see them in the JSON output. Comments are not preserved in either direction.

Câu hỏi thường gặp

Can I convert JSON to YAML and back?

Yes. Pick the target format and the tool will validate the input first, then emit a pretty-printed version in the other format.

Does this support YAML anchors or multi-document streams?

It supports standard YAML 1.2 features via js-yaml. Multi-document YAML (--- separators) is parsed; only the first document is converted to JSON.

Is my data sent anywhere?

No. Parsing and formatting happen entirely in your browser.

Các công cụ được port từ DevOps Daily theo giấy phép MIT.Xem bản gốc

Công cụ khác

Tính subnet CIDR

Phân tích dải CIDR, tính dải địa chỉ, chia nhỏ subnet và kiểm tra một IP có nằm trong mạng hay không.

Mở công cụ

Giải mã JWT

Xem nội dung bất kỳ JWT nào ngay trên trình duyệt. Không gửi gì lên server.

Mở công cụ