Skip to content
JamdeskUtilities
Free · Open source · Client-side

YAML Validator

Validate YAML syntax and find errors

How to Validate YAML

Paste YAML into the editor and it's checked as you type. Syntax errors, duplicate keys at any nesting level, and tabs used for indentation come back with a line number, a column, and a message. Anything that parses cleanly is shown as formatted JSON in the output panel, which is the fastest way to confirm that the structure you got is the structure you meant.

What the validator checks

Three things, in order. Tabs at the start of a line are caught first, because YAML requires spaces and a tab there fails every parser you hand the file to. Then the yaml package parses the document in strict mode with uniqueKeys enabled, which surfaces malformed key-value pairs, broken indentation, and duplicate keys. Whatever survives is serialized back out as JSON, so you can read the parsed structure instead of guessing at it.

Duplicate key detection

Duplicate keys are the ones that hurt. YAML doesn't complain about them. The later value quietly wins, and the config you thought you shipped isn't the config running. Strict mode turns that into an error with a line number. Keys sharing a name under different parents are fine, as they should be, and only a real collision at the same level gets flagged.

Common YAML mistakes

Tabs instead of spaces. A missing colon after a key. Nesting that sits one level off from what you meant, which parses fine and quietly means something else. Duplicate keys. And the subtle one: values that are not the type you assumed. Write version: 1.10 and the JSON panel shows 1.1, because YAML read it as a number. Write country: no and this parser keeps the string "no", but a YAML 1.1 parser on the other end will hand your application false. The error list catches the syntax problems; the JSON output is what catches the rest.

Frequently Asked Questions

Is the YAML Validator free and open source?
Yes. The YAML Validator is free and open source under the Apache 2.0 license. The full source code is on GitHub at github.com/jamdesk/utilities, and there are no ads, accounts, or usage limits.
Does it catch duplicate keys?
Yes, at any nesting level. The parser runs in strict mode with uniqueKeys enabled, so a key repeated at the same level is reported as an error with its line number instead of quietly overwriting the earlier value.
What is the difference between YAML and JSON?
YAML uses indentation for structure, JSON uses braces and brackets. YAML adds comments, multi-line strings, and anchors, none of which JSON has, and JSON is accepted by far more tooling in return. The data model underneath is the same, which is why you can convert between them.
Why does YAML not allow tabs?
Because tab width is an editor setting, not a fixed value. A file indented with tabs looks correctly nested in one editor and wrong in another, and the parser has no way to tell which one you meant. The spec sidesteps the problem by requiring spaces.

About this tool

The YAML Validator is free and open source. It runs entirely in your browser. Your input is never uploaded, stored, or logged. Open the network tab in your developer tools while the tool runs and you can confirm that for yourself. The full source code is on GitHub under the Apache 2.0 license, so you can read the code, file issues, or fork the project. There are no ads, no accounts, and no usage limits. Built and maintained by Jamdesk.

Maintained by Jamdesk · Last reviewed

YAML frontmatter powers your docs

Jamdesk validates frontmatter automatically when you deploy documentation. Start for Free

Related Tools