YAML to JSON Converter & Validator
Paste YAML to get JSON, or JSON to get YAML. It validates as you type and points at the line that broke, handles multi-document files separated by ---, and quotes values like yes and no so kubectl reads them as strings.
Free, no signup. Runs entirely in your browser; nothing you enter is sent anywhere.
✓ Valid YAML
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "web",
"labels": {
"app": "web"
}
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": {
"app": "web"
}
},
"template": {
"metadata": {
"labels": {
"app": "web"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": "nginx:1.27",
"ports": [
{
"containerPort": 80
}
],
"env": [
{
"name": "FEATURE_FLAG",
"value": "on"
}
]
}
]
}
}
}
}Why the YAML output quotes "yes", "on" and "NO"
YAML 1.1 treats yes, no, on and off as booleans, so the country code NO silently becomes false. That's the Norway problem. This tool parses with YAML 1.2 rules, where those stay strings, and writes output that quotes them, so the result means the same thing to a 1.1 parser (the Go library behind kubectl and Helm) and a 1.2 one. Background in KYAML: Kubernetes YAML without the Norway problem.
Multi-document files
A Kubernetes manifest often holds several objects separated by ---. Converting to JSON turns them into a JSON array, one element per document. Going back, tick "Array → multiple docs" to split a top-level array into separate documents again instead of a YAML list.
What doesn't survive the round trip
JSON has no comments, anchors or aliases. Anchors (&base) and merge keys are expanded into full copies, and comments are dropped. If you keep config in YAML for the comments, convert a copy rather than the original.
Questions people ask
Is it safe to paste a Kubernetes manifest or Helm values file here?
Yes. Parsing and conversion run in your browser with JavaScript; the text is never uploaded. Still, avoid pasting live secrets anywhere you wouldn't paste them into your own terminal history.
Why does my YAML fail with 'bad indentation' or 'implicit map keys need to be followed by map values'?
Almost always a tab character or one line indented differently from its siblings. YAML only allows spaces for indentation, and every item in the same list or map must start at the same column. The error shows the line and column to look at.
Is JSON valid YAML?
Nearly always. YAML 1.2 is a superset of JSON, so you can usually paste JSON straight into a YAML file or pass it to kubectl apply -f. Converting to block-style YAML just makes it easier to read and diff.