Skip to content
ZeroServer.tools

YAML Validator

Paste YAML to validate syntax and pretty-print — multi-document streams supported; errors show line and column.

Output

How YAML validation works

YAML (YAML Ain’t Markup Language) is a human-readable data serialization format commonly used in configuration files and CI/CD pipelines. This validator uses the js-yamllibrary to parse your input — any syntax error (unclosed quotes, bad indentation, duplicate keys) is reported with the exact line and column. It validates multi-document streams (separated by ---, common in Kubernetes manifests and CI matrices), and re-serializes valid YAML pretty-printed with consistent 2-space indentation.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Getting a line and column for a parse failure that a CI runner reported without one.
  • Checking a manifest before committing, so the pipeline does not fail on syntax.
  • Confirming a value's inferred type before a deployment reads it as the wrong thing.
  • Validating a file assembled from templates where the indentation is generated.
  • Checking that a multi-document file separates where you intended.

Frequently Asked Questions

What are the most common YAML errors?
Indentation with a tab character — YAML forbids tabs for indentation outright — followed by a missing space after a colon, inconsistent indent depth between siblings, and an unquoted string containing a colon, which YAML reads as a nested key.
Why does my value become true or a number?
YAML's implicit typing. `yes`, `no`, `on`, `off`, `true` and `false` all become booleans, a version like `1.20` becomes the number 1.2, and a MAC address or a time can become a sexagesimal integer. Quote anything that must stay a string.
What is the Norway problem?
The best-known instance of the above: a list of country codes containing `NO` parses as boolean false, so Norway silently disappears. YAML 1.2 narrowed the boolean set, but most parsers — including the one behind most CI systems — still follow 1.1 here.
Are duplicate keys an error?
The specification says they are invalid, but parsers disagree in practice: many take the last one and carry on silently, which is how a config change can appear to do nothing at all. Validation here reports them rather than quietly resolving them.
Does it handle multi-document files?
Yes — `---` separators split a stream into several documents, and each is validated in turn. That is what Kubernetes manifests use, and it is why a file that looks like one object may actually be five.
Does valid YAML mean the file will work?
No — it means the syntax parses. A Kubernetes manifest or CI config can be perfectly valid YAML and still be rejected for a wrong key or a missing field, which is a schema question rather than a syntax one.

Common errors and gotchas

  • Assuming valid YAML means a valid manifest. Schema and semantics are a separate question entirely.
  • Overlooking a tab character, which is invalid and usually invisible in an editor.
  • Being caught by implicit typing, where an unquoted version, country code or boolean-like word changes type.
  • Duplicating a key, which some parsers accept silently and resolve to the last occurrence.
  • Reading an anchor and alias as duplication rather than a reference, then editing one copy.

Related Formatters & Validators tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate