YAML Validator
Paste YAML below to check its syntax. Errors are highlighted on the exact line as you type. Free, instant, and nothing leaves your browser.
What is YAML
YAML ain't markup language. YAML is a concise data serialization language, which is typically considered easier to read than the more verbose JSON or XML. It is most often used in configuration files of servers and software applications. Clark Evans proposed the spec in 2001 as the result of an effort to simplify XML. According to his resume, at the time he conceived of YAML he was working with Python, which likely influenced the syntax of YAML as an indentation-based language.
Advantages of YAML
- Concise syntax eliminates many syntax errors common in other markup languages, such as missing closing brackets
- YAML allows users to add comments to their data, which can be useful for documentation or explaining certain parts of the data. JSON does not support comments, so any comments added to a JSON file would be treated as part of the data.
- YAML allows easy reuse of redundant configuration simply by creating a named anchor with an "&" and referencing with "*"
- YAML allows users to include multiple documents within a single file, separated by '---'. This can be useful for organizing data or separating different sections of a configuration file.
- A less commonly used advantage is that YAML allows custom data typing, when the core or advanced data types are insufficient
About YAML Checker
YAML checker aims to be the YAML validator of choice for developers. The tool provides a simple interface to input YAML content (just copy + paste!), view your content with syntax highlighting, and instantly display any issues with your YAML along with a line number causing the problem. Once you have fixed your YAML, the validator will instantly update to indicate that your input is free of errors with a green success message.
More YAML Tools
- YAML to JSON Converter – Convert YAML to JSON online instantly.
- JSON to YAML Converter – Convert JSON to YAML online (on JSON Checker).
- YAML Formatter – Format and beautify YAML online.
- YAML Diff – Compare two YAML files online and see exactly which keys were added, removed, or changed.
- YAML Parser & Viewer – Parse YAML online and browse the result as a collapsible tree.
- Kubernetes YAML Validator – Validate Kubernetes YAML manifests online.
- Docker Compose Validator – Validate docker-compose.yml online.
Learn YAML
- YAML Comments
- YAML vs JSON
- YAML Multiline Strings
- .yml vs .yaml
- YAML Anchors and Aliases
- YAML Arrays and Lists
- YAML Dictionaries and Maps
YAML Alternatives
- JSON (JavaScript Object Notation)
- TOML (A minimal configuration file format)
- JSON5 (A proposed extension to JSON)
- BSON (Binary JSON)
- XML (Extensible Markup Language)
- CSON (CoffeeScript Object Notation)
- CSV (Comma Separated Values)
- Protocol Buffers
- MessagePack (An efficient binary serialization format)
Frequently asked questions
How do I check if my YAML is valid?
Paste the YAML into the editor above. It is parsed on every keystroke; a green message means the file is valid, and a red message shows the error with the line number highlighted in the editor.
Is my YAML uploaded to a server?
No. Validation runs entirely in your browser using the js-yaml library. Nothing you paste is sent anywhere or stored.
What are the most common YAML syntax errors?
Inconsistent indentation, tabs instead of spaces, a missing space after a colon or dash, unclosed quotes, and duplicate keys. The validator reports each of these with the exact line.
Which YAML version does the validator use?
YAML 1.2 via js-yaml 4. Note that YAML 1.2 treats yes/no/on/off as plain strings, while older YAML 1.1 parsers such as PyYAML treat them as booleans.
Can I validate multiple YAML documents at once?
The validator checks a single document. To check a multi-document stream separated by ---, use the YAML formatter or the Kubernetes YAML validator, which both handle multiple documents.