YAML validator
Check your YAML for syntax errors — and read the normalised output, because most YAML bugs are files that parse cleanly and mean the wrong thing.
Conversion happens in this browser tab. Nothing is uploaded, logged, or stored.
What is being checked
Your document is parsed with a YAML 1.2 parser. Syntax errors are reported with a line and column, and where the underlying message is cryptic it is translated into something you can act on. If the document parses, you get the normalised YAML back — which is worth reading, because seeing how the parser understood your file often reveals a structural mistake that was never a syntax error at all.
That is the difference between a YAML validator and a JSON one. Most YAML bugs are not invalid files. They are valid files that mean something other than what the author intended: a list item indented one space too far, a value that became a boolean, a key that ended up nested under its sibling.
Common failures and their fixes
A tab character is not allowed
YAML forbids tabs in indentation. The file will look correctly aligned in your editor and still fail. Convert tabs to spaces and set your editor to insert spaces for YAML files.
Bad indentation of a mapping entry
Two sibling keys at different indentation levels, which the indentation rules cover in full. Every key in the same mapping must start at the same column — not "roughly aligned", exactly the same.
Duplicated mapping key
The same key appears twice in one mapping. JSON tolerates this and keeps the last value; strict YAML rejects it. This is a common result of a bad merge.
Could not find expected ':'
Usually an unquoted value containing a colon, or a line that was meant to be a list item but is missing its hyphen.
Mapping values are not allowed in this context
A colon appears inside a plain scalar where the parser is not expecting one. Quote the value.
Found unexpected end of stream
An opening quote or bracket has no partner. This is one of the messages that points at the wrong place: the parser reads to the end of the file before it can be sure anything is wrong, so it reports the final line. Search upwards for a line with an odd number of quotes.
Valid but wrong
Some documents parse cleanly and still ruin your day. A syntax validator cannot catch them, so check the parsed output.
| You wrote | The parser saw |
|---|---|
country: NO | Boolean false, under YAML 1.1 parsers |
version: 1.10 | The float 1.1 |
port: 0755 | Octal 493, under YAML 1.1 |
time: 12:30 | A sexagesimal number, under YAML 1.1 |
value: null vs value: | Both null — an empty value is not an empty string |
sha: 1e5 | The float 100000 |
The fix in every row is the same: quote the value. When in doubt about a scalar that is meant to be text, quote it.
Once it parses, the YAML formatter will normalise the indentation, and converting to JSON is a quick way to see the structure the parser actually built.
Validating in a pipeline
# yamllint catches style problems as well as syntax
pip install yamllint
yamllint -d relaxed .
# parse-only check, no extra tools
python -c 'import sys,yaml; yaml.safe_load(open(sys.argv[1]))' config.yaml
# schema-aware, for Kubernetes manifests
kubectl apply --dry-run=client -f manifest.yaml
Your broken file stays yours
The YAML that will not parse is usually the one pulled straight off a production cluster, secrets and all, at the moment a deploy failed. Nobody sanitises a file before pasting it into a validator at that point.
So this one does not need sanitising. The parser runs in your browser tab. Your document is not uploaded, not logged, and not retained — there is no server-side step in which any of that could happen.