YAML Validator & Formatter
Find YAML errors by line, catch YAML 1.1 traps, check Compose and Actions files, format.
Checked as you type. Drop a .yaml or .yml file here — it is read on your device, never uploaded. Ctrl/⌘ + Enter checks now.
Problems
Schema
About the YAML Validator & Formatter
Paste a YAML file — a docker-compose.yml, a GitHub Actions workflow, a Kubernetes manifest, an Ansible playbook, any config — and find out whether it is valid. Syntax errors are shown with the exact line and column and a plain explanation; duplicate keys, tab indentation and aliases whose anchor is missing (or sits in another --- document) are reported too, as are aliases that would expand without limit.
Valid YAML can still be read differently by different programs. The validator lists every plain value that YAML 1.1 parsers (PyYAML, Ruby's Psych) and YAML 1.2 parsers disagree about — yes, no, on, off, NO (the "Norway problem"), 0755, 22:22, dates — and explains how to write it. Choose a schema to check the structure as well: the Compose Specification and the GitHub Actions workflow schema are built in, or paste any JSON Schema. Format re-indents the file and keeps your comments.
How to use it
- Paste YAML, open a
.yaml/.ymlfile, drop it on the box, or pick a sample. It is checked as you type. - Read the problems: each has its line and column, a snippet and a Show button that selects it in the editor.
- To check the structure, choose a Schema — Docker Compose, GitHub Actions workflow, or Your own JSON Schema (paste it into the box that appears). The tool suggests the right one when it recognises the file.
- Press Format to re-print the YAML with 2- or 4-space indentation (optionally sorting keys or turning
{…}/[…]into block style), then copy, download or replace the input.
Examples
server: host: example.com port: 8080 host: example.org
Line 4, column 3: Map keys must be unique. This key appears twice in the same mapping…
PyYAML and many other parsers silently keep the last value, so the bug goes unnoticed.
services:
web:
image: nginx
enviroment:
DEBUG: "1"Line 4, column 5 · /services/web/enviroment — Property "enviroment" is not allowed here. Did you mean "environment"?
With Schema: Docker Compose.
ports: - 22:22
Line 2, column 5: "22:22" is the string "22:22" in YAML 1.2 (used here), but YAML 1.1 parsers read it as a base-60 (sexagesimal) number: 1342. Quote times and port mappings such as "22:22".
Docker's documentation recommends quoting port mappings for this reason: - "22:22".
Common uses
- Checking
docker-compose.ymland.github/workflows/*.ymlbefore you commit and wait for CI. - Finding the line that breaks a Kubernetes, Helm values, Ansible or OpenAPI YAML file.
- Making sure a config means the same thing to Python (PyYAML), Ruby and JavaScript tools.
- Tidying YAML indentation without losing comments.
What is checked
- Syntax (YAML 1.2, or 1.1 if you choose it or the file starts with
%YAML 1.1): indentation, unclosed quotes and brackets,key: value: valueon one line, invalid escapes, reserved characters such as@at the start of a plain value. - Duplicate keys in a mapping — an error in YAML, but silently "last one wins" in most parsers.
- Tabs used for indentation (YAML only allows spaces).
- Anchors and aliases: an alias with no anchor before it in the same document, an alias to an anchor in another document (anchors do not cross
---), recursive aliases, aliases that would expand into more than 200,000 values (the "billion laughs" attack), and anchors that are never used. - Version differences: plain values that YAML 1.1 and 1.2 read differently, numbers that look like versions (
1.10is the number 1.1) and integers too large for JavaScript. - Schema (optional): every document is converted to JSON and validated; each problem points to its line.
The bundled schemas
The Compose Specification schema comes from the compose-spec project and the GitHub Actions workflow schema from SchemaStore — both Apache-2.0, copies bundled with this page, so nothing is downloaded when you validate. The workflow schema is applied with draft 2019-09 rules, so that the keywords it places next to $ref (such as the list of allowed event types) are checked.
Schemas describe structure only: Compose and GitHub also check things a schema cannot, such as whether an image exists or a referenced job id is defined.
Limitations
- The bundled schemas are snapshots; options added to Compose or GitHub Actions after September 2026 may be reported as unknown.
- Custom tags (for example
!include,!vaultor CloudFormation's!Ref) are not executed; CloudFormation tags are converted to their JSON form for schema checks. - Formatting re-prints the document with consistent indentation and spacing; it keeps comments, anchors and quote styles, but blank lines and the exact position of some comments may change.
- Files are checked in your browser — very large files (tens of megabytes) can take a few seconds.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
Is my YAML uploaded?
No. Parsing, schema validation and formatting all happen in your browser, and the bundled schemas are part of the page. It works offline once loaded.
Why is my file valid here but rejected by another tool (or the other way round)?
Usually because of the YAML version. YAML 1.2 is the current standard, but PyYAML, Ruby's Psych and many older libraries implement YAML 1.1, where on, yes and no are booleans and 0755 is octal. Switch Read YAML as to 1.1 to see the file the way those parsers do.
Why does it warn about "on" in my GitHub workflow?
GitHub reads the on: key correctly, so the workflow itself is fine. But any tool that loads the file with a YAML 1.1 parser (a Python script using PyYAML, for example) sees the key True instead of on. The warning is informational; quoting the key ("on":) avoids it everywhere.
Can I validate Kubernetes manifests?
The syntax and YAML checks work for any Kubernetes file. For structural checks, choose Your own JSON Schema and paste the JSON Schema for the resource kind you are writing.
Does formatting change my data?
No — values, comments, anchors and quoting stay as they are, and every number is written exactly as it was (1.10, 1.0e+5 and long decimals are not re-formatted or rounded); only indentation and spacing are normalised. With Sort keys, the members of every mapping are put in alphabetical order (mappings that use << merge keys keep their order); if that would put an alias before its anchor, the formatter tells you instead of producing broken YAML.