JSON to YAML Converter: Prep Configs for K8s and CI
JSON works well for APIs and generators. YAML is what many ops tools expect: Kubernetes manifests, GitHub Actions, Ansible, and similar config files. When you receive JSON, convert it to YAML and validate before you commit.
Use the JSON to YAML Converter to convert cleanly in the browser.
Quick steps
- Paste valid JSON into the editor.
- Copy the YAML output (updates in real time as you edit).
- Validate with YAML Validator if the file goes into a pipeline.
- Format or tweak indentation with YAML Formatter if needed.
Example
JSON:
{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": { "name": "app-config" },
"data": {
"LOG_LEVEL": "info",
"FEATURE_X": "true"
}
}
YAML:
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
LOG_LEVEL: info
FEATURE_X: "true"
Arrays become dash lists. Nested objects use indentation, the usual YAML shape for K8s-style configs.
When teams use this
| Source | Destination |
|---|---|
| API export (JSON) | Hand-edited YAML config repo |
| Terraform / CDK JSON fragment | CI template in YAML |
| CloudFormation JSON | YAML for tools that prefer .yaml configs |
Need the reverse direction? Use YAML to JSON. For CloudFormation JSON, this tool handles the structural conversion. You still need to validate resource-specific fields yourself.
Common mistakes
- Expecting comments to survive. JSON has no comments; they will not appear in converted YAML.
- String vs number. YAML may quote values differently than JSON; confirm types for flags and ports.
- Invalid JSON. Fix with JSON Validator before converting.
- Tabs in edited YAML. YAML requires spaces for indentation. Never use tabs.
Verification checklist
- Run output through YAML Validator.
- Check list indentation (
- item) for array fields. - Before
kubectl apply, dry-run in your cluster or use your usual manifest checks.
