Data & Formats

YAML Validator

Paste YAML to check that it parses. Errors are shown with the line, column and the offending line, and common gotchas such as tabs and unquoted yes/no values are flagged.

Guide: YAML Errors: Fix 'Mapping Values Are Not Allowed Here'

Ready. Paste YAML to validate it.

What it does

The validator parses your text as YAML and tells you whether it is well-formed. It catches the mistakes that break configuration files most often: wrong indentation, a missing colon or space after a colon, unclosed quotes and brackets, unknown aliases, duplicate keys and tabs used as indentation.

What it does not do

A file can be valid YAML and still be wrong for its purpose. This tool checks syntax only, not whether a Kubernetes manifest, Docker Compose file or GitHub workflow has the fields those tools expect. To check the shape of the data, convert it with the YAML to JSON Converter and use the JSON Schema Validator.

Good to know

The parser follows YAML 1.2. It warns when an unquoted yes, no, on or off appears, because YAML 1.1 tools read those as booleans. Custom tags are ignored and explicit ? complex keys are supported only in simple forms.

Common YAML errors and how to fix them

These are the messages this validator shows for typical mistakes:

  • Tab indentation. A line that starts with a tab gives “Tabs cannot be used for indentation.” YAML allows only spaces for indentation, so switch your editor to insert spaces.
  • Duplicate key. Writing a: 1 and then a: 2 gives “Duplicate key "a".” Parsers disagree about which value wins, so each key should appear once.
  • Unclosed flow collection. a: [1, 2 gives “Unterminated flow collection.” Close the bracket.
  • Unclosed quote. key: "unclosed gives “Unterminated quoted string.”
  • Colon inside a plain value. a: b: c gives “Mapping values are not allowed in this context (quote the value if it contains ": ").” Write a: "b: c".
  • Wrong indentation. A list item that is indented one space less than its neighbours gives “Bad indentation of a mapping entry.” Keep items in the same list at the same indentation.

YAML 1.1 and 1.2: the yes/no problem

In YAML 1.1, which some libraries still implement, the unquoted values yes, no, on and off are booleans, so a country code written as no can turn into false. YAML 1.2 treats them as plain text. This validator follows YAML 1.2 and warns about those words so that a file does not behave differently in another tool. Quote the value if you mean text.

Frequently asked questions

How many spaces should I indent with?

Any number works as long as you are consistent inside a block. Two spaces is the most common choice in Kubernetes, Docker Compose and GitHub Actions files.

Can YAML contain comments?

Yes. A comment starts with # and runs to the end of the line. JSON has no comments, so they are lost when you convert YAML to JSON.

Does a valid result mean my Kubernetes or Docker Compose file is correct?

No. The validator checks syntax only, not whether the fields make sense for that tool. See the notes above and use the YAML to JSON Converter with the JSON Schema Validator to check the shape.

Is my YAML uploaded?

No. The validator runs in your browser.

Privacy

This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.

Share this tool

Your data is not included in this link.