What is a YAML validator?
YAML is a human-friendly data format built on indentation, the standard for configuration in Docker Compose, Kubernetes, Ansible, GitHub Actions, CI pipelines and OpenAPI specs. Because whitespace carries meaning, a single extra space can stop a deployment or silently move a setting under the wrong parent.
A YAML validator parses the file the same way your tools will and tells you whether it's valid, and if not, exactly where it breaks. This one also reformats valid YAML with consistent indentation and can show the parsed data as JSON, so you can confirm every key and value lands where you intended.
How to use the YAML Validator
1.Paste your YAML
Docker Compose, Kubernetes, GitHub Actions, OpenAPI or any config file.
2.Read the verdict
Valid YAML is reformatted; an error shows its line and column.
3.Choose the output
Formatted YAML with 2 or 4 spaces, or the same data as JSON.
Example: an app config with two servers
A file with an app section (name, port 8080, debug false) and a list of two servers with host and weight:
- Status
- Valid YAML
- Documents
- 1
- As JSON
- "port": 8080 and "debug": false, a number and a boolean
- With b: indented one space
- Invalid YAML (line 1, column 4)
The valid file passes; shifting one key by a single space is caught with its position.
Errors with a line number
YAML relies on indentation, so one misaligned space changes the meaning or breaks the file. The validator uses the yaml library, which follows the YAML 1.2 specification, and reports the first problem with its line and column, such as a nested mapping where a value was expected or a tab used for indentation.
Files with several documents separated by --- are checked one by one. Converting to JSON shows exactly how a program will read the data, which is the fastest way to discover that a value like 1.10 or an unquoted date isn't the type you expected.
Frequently asked questions
Can YAML use tabs?
No. YAML indentation must use spaces. A tab gives an error.
Why is my value a string instead of a number?
Convert to JSON to see the types. Quoted values are always strings, and YAML 1.2 treats yes, no, on and off as plain strings, unlike older YAML 1.1 tools.
Does formatting keep my comments?
Yes. Comments are kept when the output is YAML. JSON has no comments, so they're dropped there.
Does it check Kubernetes or Compose rules?
No. It checks YAML syntax, not whether the keys are right for a particular tool.
Related tools
JSON ↔ YAML Converter
Convert JSON to YAML and YAML to JSON.
JSON Formatter & Validator
Pretty-print, minify, sort and validate JSON with line-numbered errors.
XML Formatter & Validator
Pretty-print, validate or minify XML.
HTML Beautifier & Minifier
Indent messy HTML or minify it for production.
CSS Beautifier & Minifier
Format CSS readably or minify it safely.
JavaScript Beautifier & Minifier
Format JavaScript, or minify it with Terser.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table