Pages

Topics

Tools

↑↓navigate↵openescclose
Formatting & Data

YAML ↔ JSON

Convert YAML configuration into JSON and back, with indent control and Kubernetes or GitHub Actions presets.

Runs entirely in your browser — nothing you paste is uploaded.

Presets

Maps, sequences, flow styles, quoted strings, block scalars, and comments are supported. Anchors, aliases, and tags are not expanded.

live
JSON
1,189 chars · 59 lines
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": {
    "name": "ryuslog-web",
    "labels": {
      "app": "ryuslog",
      "tier": "frontend"
    }
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "matchLabels": {
        "app": "ryuslog"
      }
    },
    "template": {
      "metadata": {
        "labels": {
          "app": "ryuslog"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "web",
            "image": "ghcr.io/ryuslog/web:1.4.0",
            "ports": [
              {
                "containerPort": 3000
              }
            ],
            "env": [
              {
                "name": "NODE_ENV",
                "value": "production"
              }
            ],
            "resources": {
              "limits": {
                "cpu": "500m",
                "memory": "512Mi"
              }
            },
            "readinessProbe": {
              "httpGet": {
                "path": "/api/health",
                "port": 3000
              },
              "initialDelaySeconds": 5,
              "periodSeconds": 10
            }
          }
        ]
      }
    }
  }
}

YAML syntax reference

quick reference
key: value
A mapping entry. The colon must be followed by a space, and indentation must use spaces, never tabs.
- item
A sequence entry at its own indentation level; nested keys of one entry align under the item text.
|
Literal block scalar that keeps line breaks, which is what multi-line shell scripts and config files use.
>
Folded block scalar that joins wrapped lines with spaces, for long single paragraphs.
[a, b] / {k: v}
Flow style abbreviations for a short sequence or mapping on one line.
# comment
Comments run to the end of the line and are lost when the document is converted to JSON.
All Kubernetes guides