How to use
- 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.
- In Diagnostics, click an error or warning to jump to its location.
- Correct the marked YAML in the editor.
- Open Formatted after fixing the errors to review the re-indented YAML.
- Click Download to save the formatted YAML file.
Examples
Docker Compose service
services:
web:
image: "nginx:1.25"
ports:
- "80:80"
Valid YAML YAML 1.2 · 1 document · 4 keys · depth 4
Misaligned application settings
app: name: inventory-api port: 8080
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
host: localhost port: 8080 port: 3000
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
| Error | Example | How to fix |
|---|---|---|
| Bad indentation | a:↵ b: 1↵ c: 2 | Keys of the same map must start in the same column. |
| Tab used for indentation | →x: 1 | YAML allows only spaces for indentation. |
| Mapping on the same line as its key | a: b: c | Quote the value (a: "b: c") or move b: c to an indented line. |
| Unclosed quote or bracket | a: "text | Add the closing ", ', ] or }. |
| Value starts with a reserved character | k: @x | Put the value in quotes: k: "@x". |
| Duplicate key | a: 1↵a: 2 | Remove or rename one of the keys — most parsers keep only one value. |
| "Norway problem" (YAML 1.1) | country: no | YAML 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.