← Back to tool

Kubernetes · Manifest · Deployment

YAML Kubernetes — Convert to JSON

Updated: May 2026

Kubernetes manifests are written in YAML. To debug them, validate against a JSON Schema, inject into an API, or compare with JSON diffing tools, you need to convert them. This tool does it entirely in the browser — your cluster configs never reach an external server.

Convert a Kubernetes manifest →

Free · No upload · Browser-based

Example Kubernetes Deployment in YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  labels:
    app: my-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: my-app
  template:
    spec:
      containers:
        - name: my-app
          image: my-app:1.0
          ports:
            - containerPort: 8080

Converts to a complete JSON object with preserved types (integers, booleans, strings) — ready to use via the Kubernetes REST API or kubectl.

When to convert a Kubernetes manifest to JSON

  • Debug a YAML parse error by inspecting the parsed JSON structure.
  • Validate a manifest with a JSON Schema tool (OPA, Conftest, Kyverno).
  • Apply resources via the Kubernetes REST API (which accepts JSON).
  • Compare two manifest versions with a JSON diff tool.
  • Generate reports or documentation from config data.

Key notes for Kubernetes manifests

  • Multi-document files: files with multiple resources separated by --- should be split before conversion — one resource per conversion.
  • Strict typing: Kubernetes is type-sensitive. replicas: 2 must stay an integer, not a string.
  • Labels and annotations: Kubernetes always treats these as strings — verify they aren't misinterpreted.

Frequently asked questions

Can I convert Helm values.yaml files?

Yes. Helm values files are standard YAML and convert without issue.

Should Kubernetes Secrets be encrypted before converting?

Kubernetes Secret data is base64-encoded, not encrypted. The tool converts them as-is. Avoid pasting sensitive secrets into any online tool.

Are ConfigMaps with multiline data supported?

Yes. YAML block scalars (|) used in ConfigMaps are converted to JSON strings with \n characters.