Kubernetes YAML to JSON Converter

Convert K8s manifests between YAML and JSON for kubectl and automation.

Working with Kubernetes Manifests in JSON

Kubernetes accepts both YAML and JSON for manifest files, but most documentation and examples use YAML. When you need to script deployments, template manifests programmatically, or interact with the Kubernetes API directly, JSON is often more practical because it's easier to generate and manipulate in code.

Convert your Deployment, Service, ConfigMap, Secret, or any other K8s resource between formats. This is useful when using kubectl with the -o json flag to get machine-readable output, or when building custom controllers and operators that construct manifests as JSON objects.

The converter handles all standard Kubernetes YAML patterns including multi-line strings (for ConfigMap data), resource limits with unit suffixes, and label selectors. Paste a manifest from your k8s/ directory and get clean JSON ready for API calls or programmatic processing.

Tips

  • kubectl get deployment -o json outputs JSON directly — useful for scripting without converting.
  • The Kubernetes API server internally works with JSON. YAML manifests are converted to JSON before processing.
  • Use kubectl apply -f - to apply JSON from stdin — pipe your converted JSON directly.
  • For templating, consider Helm (YAML) or cdk8s (generates JSON) depending on your workflow.

Ready to get started?

Convert K8s YAML

New tools every week

Get notified. No spam.