100% local — your data never leaves your browser

YAML Validator — The Line Where It Stops

Check that YAML parses: indentation, quoting, anchors, duplicate keys. When it stops parsing, you get the line, so you know where to look.

Instant Private Zero cookies

YAML input

Result output

What this tool checks

That the document parses, which for YAML means rather more than it sounds:

  • indentation is consistent, and built from spaces;
  • quoting is closed, and block scalars (|, >) are indented correctly;
  • every alias *name has an anchor &name to point at;
  • no mapping has the same key twice;
  • --- separators produce whole documents.

When it passes, you get the root’s shape and the size. When it fails, you get the parser’s message with the line and column — and YAML parsers are unusually good at saying where.

Validator, checker, parser — and .yml against .yaml

Syntax checker, format checker, parser, tester, validator: five names for one question — does this document parse? That is what happens when you paste.

.yml and .yaml are the same language, not two variants. The extension is a habit: the YAML project asks for .yaml, while a generation of tools wrote .yml first and never moved. Docker Compose reads both, GitHub Actions reads both, and so does this page — nothing inside the file says which spelling it arrived under.

Tabs are not indentation

A tab is eight columns wide, or four, or two, depending on who is looking. Indentation built from tabs therefore has no defined meaning, and in YAML indentation is the structure. The specification forbids them, and so does this.

Inside a quoted scalar a tab is just a character and perfectly fine. Only the left margin is the problem.

Duplicate keys are an error

port: 8080
host: example.com
port: 3000

The specification says a mapping’s keys must be unique. Plenty of parsers ignore that and keep the last one, which is how a configuration file silently runs on a value you forgot you had written twice. Here it is an error, with the line of the second one.

A stream of several documents is valid

--- separates documents, and a file may hold any number. The report says how many. A Kubernetes manifest is usually a stream, and a stream is not a syntax error.

What it does not check

Whether the document means anything.

A file can be perfect YAML and a broken Compose file: a service with no image, a key spelled enviroment, a port quoted where a number was expected. None of that is syntax, and nothing here will catch it.

Nor does it decide what a bare word means. yes is the string yes to a YAML 1.2 reader and the boolean true to a YAML 1.1 one, and both are reading valid YAML — a difference this validator cannot resolve for you, because it depends on who reads the file next.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Why are tabs rejected as indentation?
Because a tab has no defined width, so indentation built from tabs has no defined meaning — and indentation is YAML’s entire structure. The specification forbids them outright. Tabs inside a quoted value are fine; only indentation is the problem, which is why the message names line and column.
Why is a duplicate key an error rather than last-wins?
Because the YAML specification says keys must be unique, and last-wins is how a configuration silently ignores half of what you wrote. If a file sets `port: 8080` at the top and `port: 3000` at the bottom, you want to be told, not to spend an afternoon wondering which one is running.
Does this check my docker-compose or Kubernetes file?
No. It checks that the YAML parses. A file can be flawless YAML and a useless Compose file — a service with no image, a misspelled key, a port as a string where a number was expected. Schema validation needs the schema, and that is a different tool.

Related converters