Skip to content

YAML Validator

Check YAML syntax and see each error with its line, column and a hint to fix it.

Paste YAML or upload a .yaml file to check it.

Duplicate keys
Indent (Formatted)
Runs in your browser — your data is not uploaded.

Checks YAML 1.2 syntax (yaml 2.9.1, core schema). Does not check Kubernetes, Compose or other schemas.

How to use

  1. Type or paste YAML into the editor, click Paste to load it from your clipboard, or click Upload to select a .yaml, .yml or .txt file. Click Example to load a sample.
  2. In Diagnostics, click an error or warning to jump to its location.
  3. Correct the marked YAML in the editor.
  4. Open Formatted after fixing the errors to review the re-indented YAML.
  5. Click Download to save the formatted YAML file.

Examples

Docker Compose service

Input
services:
  web:
    image: "nginx:1.25"
    ports:
      - "80:80"
Output
Valid YAML
YAML 1.2 · 1 document · 4 keys · depth 4

Misaligned application settings

Input
app:
  name: inventory-api
 port: 8080
Output
1 error found
Line 3, column 1: Bad indentation. Items at the same level must start in the same column.

Treat a repeated port setting as an error

Input
host: localhost
port: 8080
port: 3000
Output
1 error found
Line 3, column 1: Duplicate key "port" (first defined at line 2, column 1).

Common YAML errors and how to fix them

ErrorExampleHow to fix
Bad indentationa:↵  b: 1↵ c: 2Keys of the same map must start in the same column.
Tab used for indentation→x: 1YAML allows only spaces for indentation.
Mapping on the same line as its keya: b: cQuote the value (a: "b: c") or move b: c to an indented line.
Unclosed quote or bracketa: "textAdd the closing ", ', ] or }.
Value starts with a reserved characterk: @xPut the value in quotes: k: "@x".
Duplicate keya: 1↵a: 2Remove or rename one of the keys — most parsers keep only one value.
"Norway problem" (YAML 1.1)country: noYAML 1.1 tools read no as false. Quote it: "no".

FAQ

Which YAML version does this validator check?

It checks YAML 1.2 with the core schema using the yaml 2.9.1 parser. A document that declares %YAML 1.1 is read with YAML 1.1 rules and gets an informational note.

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

The tool checks YAML syntax and data rules, not Kubernetes, Docker Compose, OpenAPI, or other application schemas. A valid result does not confirm that your configuration meets those applications' requirements.

How does the validator handle duplicate keys?

A repeated key in the same mapping produces a warning by default. Set Duplicate keys to Error to make it an error that prevents formatted output.

Why do CloudFormation tags like !Ref get warnings?

Custom tags such as !Ref, !Sub, and !GetAtt are valid YAML, but only tools that define them can interpret their values. This validator warns about unknown tags and never executes them.

Is my YAML uploaded or saved?

The tool parses your YAML in your browser without uploading or saving it; option settings are saved locally. Convert to JSON → temporarily puts the YAML in sessionStorage, and the next page removes it when read. Google Analytics receives usage events and the first diagnostic code for YAML errors, but not your YAML text.