Validation Tools

YAML Validator & Formatter

Find YAML syntax errors by line and column, catch duplicate keys, tab indentation and values that YAML 1.1 parsers read differently, and reformat YAML with a consistent indent. Supports multi-document files.

Private by design: anything you enter is processed in your browser only. It is never uploaded to or logged on our servers. YAML is parsed locally with js-yaml. Share links contain the YAML, so do not share files with secrets.

Validation also runs as you type.
Paste YAML to validate it. Checking runs as you type.

About YAML validation

YAML is used for Docker Compose, Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Ansible playbooks, OpenAPI files and countless app configs. Because indentation carries meaning, one stray tab or a misaligned line can break a deployment. This validator parses your YAML with js-yaml (YAML 1.2) and shows the exact line and column of the error with the surrounding lines. Files with several documents separated by --- are checked as a whole, and each problem shows which document it is in.

Besides hard errors it lists problems that parse but cause bugs: duplicate keys (strict parsers reject them, others silently keep the last value), tabs in indentation, trailing whitespace, and values that YAML 1.1 parsers such as PyYAML, Ansible and older Go libraries read differently: unquoted yes, no, on and off are booleans there, 0755 is octal and 22:22 is a base-60 number.

Format re-indents the YAML and turns flow collections into block style. Values are written back as they were read, comments are not kept, and repeated anchors are renamed. CloudFormation (!Ref, !Sub), GitLab CI (!reference) and Home Assistant (!include) tags are accepted and kept. To convert YAML to JSON or other formats, use the data format converter; for Kubernetes-specific checks, use the Kubernetes YAML linter.

Reference Guide

The mistakes this validator finds most often:

ProblemExampleFix
Tab used for indentation image: nginxIndent with spaces only (2 is the common convention)
Missing space after the colonimage:nginximage: nginx (without the space it is one string)
Inconsistent indentationa key indented 3 spaces under siblings at 2Align keys of the same mapping exactly
Unquoted special charactersmsg: Error: failedmsg: "Error: failed"; quote values with : , #, or a leading *, &, !, @ or `
Duplicate keyenv: twice in one mappingMerge the two blocks; only one value survives
The "Norway problem"country: NOcountry: "NO" (YAML 1.1 reads NO as false)
File modes as numbersmode: 0644mode: "0644" or 0o644 depending on the tool

Example input

# docker-compose.yml with a few common mistakes
services:
  web:
    image: nginx:1.27
    ports:
      - 8080:80
    environment:
      DEBUG: no
      DEBUG: "false"
    restart: unless-stopped
  db:
    image: postgres:16
    volumes:
      - db-data:/var/lib/postgresql/data
volumes:
  db-data: {}

This sample loads automatically when you open the tool. Use Load Sample to bring it back.

Frequently Asked Questions

A key is indented differently from the other keys of the same mapping, or a value contains an unquoted ": " so the parser sees a second key. Align sibling keys exactly and quote values that contain a colon followed by a space. The validator highlights the line and column.

No. The YAML specification requires keys to be unique, and strict parsers reject the file. Many tools silently keep the last value instead, which hides bugs, so the validator lists every duplicate key with its line.

In YAML 1.2 they are plain strings, but YAML 1.1 parsers such as PyYAML, Ansible and older Go libraries read them as booleans, so country: NO becomes false. Numbers with a leading zero such as 0755 are octal there. Quote such values to be safe everywhere.

Yes. Documents separated by --- are checked together and each problem shows its document number. Custom tags such as !Ref and !Sub (CloudFormation), !reference (GitLab CI) and !include (Home Assistant) are accepted and kept when formatting.