Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

YAML Validator

YAML

Paste YAML, or

CtrlV paste · Ctrl↵ run now

Formatted YAML
Ready
Ln 1, Col 1
Runs in your browser. Nothing you paste is uploaded unless you share it.

Check YAML and find the line and column of an error: tabs, duplicate keys, open brackets, missing anchors

Paste YAML to check it. Valid YAML is confirmed with its documents and lines; YAML that isn’t valid shows where it breaks and why, and values some parsers read differently are pointed out.

How to use it

  1. Paste the YAML you want to check, or open a .yaml or .yml file.
  2. The status bar says Valid YAML, or Not valid YAML with the line and column of the first problem.
  3. Notes under the result name the lines with values YAML 1.1 parsers read differently.
  4. Under Options, Resolve aliases writes each *name out as a copy and applies merge keys; Clean characters removes invisible characters and odd spaces.
  5. Fix the text and the check runs again as you type.

Examples

A tab used to indent

Input
spec:
	replicas: 3
Result

Line 2, column 1Tabs are not allowed as indentation

YAML indents with spaces only. An editor that inserts tabs breaks the file without showing it.

NO is not always text

Input
countries:
  - GB
  - NO
Result
Line 3: NO is read as false by YAML 1.1 parsers (PyYAML, go-yaml v2). Quote it if it is text.

The file is valid, and NO is Norway here. The note says where a YAML 1.1 parser would read something else.

What it checks

The YAML 1.2 syntax: indentation with spaces, every bracket and quote closed, no key written twice in one map, every alias (*name) pointing at an anchor (&name) set before it, and each document of a stream.

It does not check the fields a program expects, such as a Kubernetes kind or a Compose service option.

Values YAML 1.1 parsers read differently

Some parsers still follow YAML 1.1, where yes, no, on and off without quotes are booleans (the country code NO becomes false), a number with a leading zero such as 0755 is octal, and 22:22 is a number in base 60.

The validator names the lines that hold such values, so you can quote the ones that are text. It is the reason port mappings in Compose files are usually written in quotes: unquoted, 21:21 can be read as 1281.

Safe with untrusted YAML

Aliases are counted, not expanded, so a "billion laughs" file that would grow to millions of copies is refused at once. Tags such as !!python/object are kept as text, not run.

Resolve aliases and clean characters

Resolve aliases writes each alias (*name) out as a copy of what its anchor (&name) marks, applies merge keys (<<: *base) with the keys written in the map winning, then the first source that has the key, and removes the anchors. The result is what a tool without anchor support reads. The same alias limit applies first.

Clean characters removes byte order marks, zero-width characters and control characters, and turns no-break, narrow and ideographic spaces into plain spaces. These are invisible in most editors but break keys and values. A note says how many were changed, and an error still points at the place in your text.

Questions

Does it show every error at once?
It shows the first one, with its line and column, because one mistake (a wrong indent, an open bracket) often makes the lines after it look wrong too. Fix it and the check runs again.
Can it expand anchors and merge keys?
Yes: turn on Resolve aliases under Options. Each *name becomes a copy, <<: merge keys become the keys they bring (keys written in the map win), and the anchors go. Comments stay.
Can it check a Kubernetes manifest or a GitHub Actions workflow?
It checks that the file is valid YAML, including a manifest with several documents. It does not check that the fields are the ones Kubernetes or GitHub expect.
Is my YAML uploaded?
No. Everything runs in your browser, so your YAML stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. Config files, Compose files and CI workflows often hold passwords, tokens or keys, and the page warns you if it spots any.

Related tools