YAML Validator
Check YAML for syntax errors, duplicate keys and other problems, each shown with its line and column. Runs in your browser.
Input
Output
Readme
What does the YAML Validator check?
YAML is the format of many configuration files: Docker Compose files, Kubernetes manifests, GitHub Actions and GitLab CI workflows, Ansible playbooks, OpenAPI specs and the settings of countless apps. Because indentation carries meaning in YAML, a missing space, a stray tab or a repeated key can break a file in ways that are hard to spot. The validator reads your YAML the way a parser does and lists every problem with its line and column.
How to use it
- Paste or type YAML in the editor.
- The result appears as you type: either the YAML is valid, with the number of documents it holds, or every problem is listed in the order of the text.
- Each problem is marked in the editor, errors in red and warnings in yellow. Click a problem to scroll the editor to it, or click a mark to find it in the list.
What it finds
- Syntax errors: unclosed quotes and brackets, items indented too little or too much, a key and a list item mixed on one level, mappings nested on one line such as
a: b: c. - Repeated keys: the same key twice in one mapping. Most parsers would silently keep only one of the values, so the other setting is lost.
- Tabs used as indentation: YAML only allows spaces for indentation.
- Aliases without anchors: a
*namealias needs an&nameanchor earlier in the same document. - Warnings for things that parse but may not work as intended, such as a tag the parser doesn't know or an unsupported
%YAMLversion.
The same key in different mappings is fine, and so is a file with several documents separated by ---: lines are counted over the whole file.
What it doesn't check
The validator checks that the text is valid YAML, not that a particular program accepts it. A Docker Compose file can be valid YAML and still name a setting Docker Compose doesn't know. The messages come from the yaml library, in English.
How it works
The tool parses the text with the yaml library, which follows the YAML 1.2 specification, with keys required to be unique. Everything runs in your browser: your files are never uploaded.
Features
- Syntax errors with line and column
- Repeated keys, tabs as indentation and aliases without anchors
- Errors and warnings marked in the editor, with click to scroll
- Files with several documents
- Runs in your browser