Skip to main content

// tool

YAML / JSON Formatter and Linter

Validate, format, and convert YAML and JSON. Browser-only.

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"
              }
            }
          }
        ]
      }
    }
  }
}

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.

Sponsored
Carbon Ads