02 / YAML / yaml-validator

YAML Validator

Validate YAML with line-level error messages.

ReadyLocal processing
02 · Workspace

How to use

  1. 01Paste YAML into the YAML input box. Validation runs live as you type.
  2. 02Check the badge: Valid or Invalid YAML.
  3. 03For valid input, the summary tells you how many documents were found. Documents are separated by --- lines.
  4. 04For invalid input, each problem is listed as its own error note with a line and column number. Work through them from the top.
  5. 05Use Copy input to take the fixed YAML back to your editor, or Clear to start over.

What is this tool?

This YAML validator parses your input with a YAML 1.2 parser and lists every syntax error it finds, each with a line and column, instead of stopping at the first one. It handles multi-document streams separated by ---, which makes it suited to checking Kubernetes manifests and other files that bundle several resources. Validation runs locally in your browser, so configs that contain secrets never leave your machine.

Common YAML syntax errors and how to fix them

"Tabs are not allowed as indentation" is the classic one. YAML only accepts spaces for indentation, and an editor that inserts a tab produces this error even when the file looks aligned. "Map keys must be unique" means the same key appears twice in one mapping. Some parsers silently keep the last value, but this one flags it, which often catches a real bug. "Nested mappings are not allowed in compact mappings" usually comes from a line like a: b: c, where a value containing ": " needs quoting.

Indentation mistakes often produce messages that seem unrelated. A list item indented one space less than its siblings can produce "A block sequence may not be used as an implicit map key". The fix is to line up every dash in the list at the same column. "Missing closing quote" means a quoted string never ends, often because the value itself contains a quote character.

Valid YAML can still mean something unexpected

A clean result means the document parses, not that it means what you intended. This validator follows YAML 1.2, where yes, no, on and off are plain strings. Some other tools still apply YAML 1.1 rules and read an unquoted country code NO as the boolean false, the so-called "Norway problem". To be safe in every tool, quote such values.

Numbers can surprise you too. version: 1.10 is read as the number 1.1, and a leading-zero value like 0755 is read as the number 755 rather than as an octal file mode. Quote version strings, file modes and anything else that must stay text. The validator checks syntax only. It doesn't check a Kubernetes or CI schema, so a valid file can still have a misspelled field name.

Common use cases

  • Checking a multi-resource Kubernetes manifest (Deployment, Service, ConfigMap) before kubectl apply
  • Tracking down why a GitHub Actions or GitLab CI pipeline fails to load its workflow file
  • Validating a Helm values.yaml override after hand-editing it
  • Catching duplicate keys in an OpenAPI spec that another tool quietly accepted
  • Checking YAML test fixtures in a pre-commit review without installing a linter

FAQ

How do I check if my YAML is valid?

Paste it into the input. The badge immediately shows Valid or Invalid YAML, and any errors are listed with their line and column.

Why is my YAML invalid?

The most common causes are tab characters used for indentation, misaligned list items, duplicate keys, unclosed quotes, and unquoted values that contain ": ". Each error message points to the line and column involved.

Does it support multiple YAML documents in one file?

Yes. Documents separated by --- are all parsed, and a valid result reports how many documents were found.

Does it validate Kubernetes or CI schemas?

No. It checks YAML syntax only, so field names and value types specific to Kubernetes, Compose or CI tools aren't verified.

Is it safe to paste YAML containing secrets?

Validation runs entirely in your browser, and nothing is uploaded. Still, avoid sharing your screen or clipboard while live credentials are visible.