What the YAML tools do
YAML is the configuration language of Kubernetes, Docker Compose, GitHub Actions, Ansible, Helm and most CI systems — and it is unforgiving about indentation. This tool validates a YAML document, reporting the line and reason for any parse error, and beautifies it with consistent two-space indentation and spacing. Parsing runs in your browser, so config files containing hostnames, keys or internal paths are never uploaded.
YAML in one screen
# Comments start with a hash
service:
name: api # key: value (a space after the colon is required)
replicas: 3 # numbers are unquoted
enabled: true # booleans: true / false
version: "1.10" # quote strings that look like numbers
ports: # a list — each item starts with "- "
- 8080
- 8443
env:
- name: LOG_LEVEL
value: info # a list of maps
description: > # folded block: newlines become spaces
A long sentence
on several lines.
script: | # literal block: newlines are kept
echo start
./run.shThe errors the validator catches most
| Symptom | Cause | Fix |
|---|---|---|
| mapping values are not allowed here | A colon in a value without quotes, or a key on the wrong indentation | Quote the value or fix the indent |
| bad indentation of a mapping entry | Mixed 2- and 4-space indents, or a tab character | Use spaces only, consistently |
| could not find expected ':' | A key missing its colon, or a list item where a key was expected | Check the line before the reported one |
| duplicated mapping key | The same key twice in one map | Remove or rename one |
| unexpected end of the stream | An unclosed quote or block | Check quotes on the last few lines |
Errors are reported at the line where parsing failed, which is often one line after the real mistake — a missing colon on line 12 usually surfaces as an error on line 13.
Traps that parse fine but mean the wrong thing
- The Norway problem: in YAML 1.1,
country: NOis the boolean false. So areyes,on,offandy. Quote them. - Octal surprise:
mode: 0755may be read as the decimal 493. Quote it, or write0o755. - Version numbers:
version: 1.10becomes the float 1.1. Quote it. - Times:
time: 12:30can be parsed as 750 (sexagesimal). Quote it. - Trailing spaces and tabs are invisible but change meaning; the beautifier removes them.
- Anchors and aliases (
&default/*default) are powerful but easy to over-use; the validator resolves them so you can see the expanded result.
What the beautifier changes
- Normalises indentation to two spaces per level.
- Puts exactly one space after each colon and dash.
- Removes trailing whitespace and collapses runs of blank lines.
- Keeps comments, key order, quoting style and block scalars as written.
The output means the same thing as the input. It does not reorder keys or change values, so it is safe to run on production configs.
YAML vs JSON
Every JSON document is valid YAML, but not the reverse. YAML adds comments, multi-line strings, anchors and a whitespace-based structure that is easier to read and write by hand — and easier to get subtly wrong. JSON is stricter, has no comments, and is better for machine-to-machine data. Use the JSON Tools page for JSON; if you need to move between them, the JSON Converter handles YAML output.