JSON to YAML for Kubernetes — K8s Config Converter
Convert JSON to YAML instantly — indent · quote style · flow mode · null/bool style · syntax highlight · 100% Free
app: name: CalcNation version: 3.0.0 debug: false features: - calculator - converter
Kubernetes configuration is written in YAML — but kubectl, Helm and API clients often work with JSON internally. This converter transforms JSON Kubernetes manifests to YAML format, making them ready for kubectl apply, Helm charts and GitOps workflows. Handles Deployment, Service, ConfigMap, Ingress and custom resource definitions.
What is JSON to YAML Conversion?
YAML (YAML Ain't Markup Language) is a human-readable serialisation format widely used in configuration files — Docker Compose, Kubernetes, GitHub Actions, Ansible, and CI/CD pipelines. This tool converts any valid JSON to clean, formatted YAML instantly, with full control over indentation, quoting, null representation, boolean style, and flow style for compact output.
YAML vs JSON — When to Use Which
JSON is ideal for APIs and data exchange — strict syntax, universally supported. YAML is preferred for configuration files — more readable, supports comments, and allows multi-line strings. Use this converter when your tooling expects YAML input (Helm charts, k8s manifests, docker-compose.yml) but your data starts as JSON.
Frequently Asked Questions
How do I apply a JSON Kubernetes manifest?
kubectl can accept both YAML and JSON: kubectl apply -f deployment.json or echo '{"apiVersion":"v1",...}' | kubectl apply -f -. JSON is fully valid for Kubernetes manifests. However, YAML is standard for storing in Git — convert to YAML for GitOps. The API server internally converts all manifests to JSON.
What Kubernetes resources can be converted between JSON and YAML?
All Kubernetes resources: Deployment, Service, ConfigMap, Secret, Ingress, PersistentVolumeClaim, StatefulSet, DaemonSet, Job, CronJob, HorizontalPodAutoscaler, NetworkPolicy, ClusterRole, ServiceAccount, and all custom resources (CRDs). The JSON/YAML structure mirrors the Kubernetes API spec for each resource type.
How do I get JSON output from existing Kubernetes resources?
kubectl get deployment my-app -o json. Add > deployment.json to save to file. kubectl get deployment my-app -o yaml to get YAML directly. To get ALL resources in a namespace as JSON: kubectl get all -n my-namespace -o json. Convert the JSON to clean YAML using this tool for storing in version control.
What is the difference between Kustomize YAML and standard Kubernetes YAML?
Kustomize adds overlay features to standard Kubernetes YAML: kustomization.yaml declares which resources and patches to apply. Base YAML: standard K8s manifests. Overlay: patches for different environments (dev/staging/prod). The merged result is standard Kubernetes YAML. Kustomize is built into kubectl (kubectl apply -k). Helm is an alternative with a full templating engine.