Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

YAML Validator & Formatter

Find YAML errors by line, catch YAML 1.1 traps, check Compose and Actions files, format.

Developer No upload Works offline Free, no sign-up

Checked as you type. Drop a .yaml or .yml file here — it is read on your device, never uploaded. Ctrl/⌘ + Enter checks now.

Format options

Next steps

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

  1. Paste YAML, open a .yaml/.yml file, drop it on the box, or pick a sample. It is checked as you type.
  2. Read the problems: each has its line and column, a snippet and a Show button that selects it in the editor.
  3. 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.
  4. 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

A duplicated key
Input
server:
  host: example.com
  port: 8080
  host: example.org
Result
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.

A typo in a Compose file
Input
services:
  web:
    image: nginx
    enviroment:
      DEBUG: "1"
Result
Line 4, column 5 · /services/web/enviroment — Property "enviroment" is not allowed here. Did you mean "environment"?

With Schema: Docker Compose.

A port mapping that YAML 1.1 turns into a number
Input
ports:
  - 22:22
Result
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.yml and .github/workflows/*.yml before 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: value on 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.10 is 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, !vault or 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.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.