YAML Validator: Check Docker Compose, GitHub Actions and Config Files

What is it?

The YAML Validator tells you whether a YAML file is valid and, if not, shows the exact line and column of the error. Paste a Docker Compose file, a GitHub Actions workflow, a Kubernetes manifest or any config. It also warns about traps that are valid but risky, such as tabs, a missing space after a colon, and words like “no” that some programs read as false, and shows the parsed data as JSON so you can see exactly what the program receives.

Who is it for?

Developers and DevOps engineers, students learning Docker or Kubernetes, and website owners editing a config file for a static site or a CI workflow.

How to use it

  1. Paste your code into the YAML to check box, or tap Try a sample to see how it works.
  2. The list of problems updates as you type: ✕ marks an error, ! a warning. The line above it sums up, for example “2 errors, 1 warning. Tap Show to jump to the line.”
  3. When the YAML is valid, open Parsed data (JSON) to see the result and tap Copy JSON if you need it.
  4. Tap Show next to a problem to jump to that line, fix it, and watch the list update. Problems that are not on one line say Whole file. Clear empties the box.

Worked example

services:
  web:
    image: nginx
     ports:
      - "80:80"

The validator reports an error on line 4: “ports” is indented one space more than “image”. Line them up and the JSON view shows web with image and ports side by side. Put strings that contain : or # or start with * in quotes.

Errors and how to fix them

  • “✓ Valid YAML”: the file parses. Check the JSON view to be sure the structure is what you meant.
  • Tab character: YAML indents with spaces only; replace every tab with spaces.
  • Bad indentation: items in the same list or map must line up exactly, to the same column.
  • Missing space after a colon: write key: value, not key:value.
  • Values like yes, no, on, off: older YAML reads them as true or false. Put them in quotes, for example country: "NO".

Open the tool: YAML Validator

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.