YAML Validator

Paste YAML to check it and see the exact line, column and document of any error, with the lines above it and a plain-English hint.

input.yaml
Validation runs as you type, in your browser. Nothing is uploaded.

What makes YAML invalid

YAML uses indentation for structure, so one misplaced space or tab can stop a whole file from parsing. These rules all have to hold:

  • Indent with spaces only. A tab at the start of a line is an error, even when your editor shows it lined up.
  • Keys of one mapping, and items of one list, start at the same column. A nested block is indented further than its parent key.
  • A key ends with a colon and a space: image: nginx. image:nginx is read as one plain value, not a key.
  • Each key appears once per mapping.
  • A value that contains : or starts with @, `, * or & needs quotes, and # starts a comment.
  • Quotes, [ ] and { } must be closed, and an alias *name needs an anchor &name before it in the same document.
  • --- starts a new document. Each document in the file is checked on its own.

Common YAML errors and how to fix them

FAQ

Is my YAML uploaded anywhere?
No. The parser loads once with the page, and validation runs in your browser. The YAML you paste is never sent anywhere.
Does it check Kubernetes, Docker Compose or GitHub Actions files?
It checks their YAML syntax, which is where most of their parse errors come from. It does not check their schemas, so a file can be valid YAML and still be rejected for an unknown or misplaced key.
Can I validate a file with several documents?
Yes. Separate documents with ---, as in a Kubernetes manifest that defines several resources. Every document is checked, and an error says which document it is in.
Are duplicate keys an error?
Yes. The YAML spec requires the keys of a mapping to be unique, so the validator flags the second one. Some parsers, PyYAML among them, accept duplicates and keep the last value, which hides the mistake.
Which YAML version does it use?
YAML 1.2, through the open-source yaml library for JavaScript. YAML 1.1 parsers such as PyYAML read some unquoted values differently, for example yes and no as booleans, but those values are valid in both.