How to use the YAML Validator
- Paste YAML or open a
.yml/.yamlfile. - Errors show the line, column and a pointer to the exact spot.
- Review the lint warnings for tabs, trailing spaces and YAML 1.1 pitfalls.
- Copy the formatted YAML or the JSON equivalent.
Why YAML breaks so easily
YAML uses indentation for structure, so a single misplaced space changes the meaning or makes the file invalid. The most common errors:
| Error | Cause |
|---|---|
| bad indentation of a mapping entry | A key is indented differently from its siblings |
| found a tab character | YAML forbids tabs for indentation — use spaces |
| duplicated mapping key | The same key appears twice in one object; most parsers silently keep the last one |
| incomplete explicit mapping pair / unexpected end | An unclosed quote, bracket or a colon inside an unquoted string |
| end of the stream or a document separator is expected | Content at the wrong indentation after a list or block |
YAML 1.1 vs 1.2 gotchas
Many tools (PyYAML, older Ruby and Go libraries) still follow YAML 1.1, where yes, no, on, off are booleans and 012 is octal — the famous “Norway problem” where the country code NO becomes false. YAML 1.2 treats these as strings. The linter flags such values so you can quote them and get the same result everywhere.
Multi-document files
Kubernetes manifests often combine several resources separated by ---. Each document is validated and shown in the JSON output as an array.
Validating meaning, not just syntax
Valid YAML can still be a wrong configuration. For structure checks against a schema, convert to JSON and use the JSON Schema validator; for API specs, the OpenAPI validator. Build new files with the Docker Compose generator or GitHub Actions generator, and convert formats with YAML to JSON.
Tools that pair well with the YAML Validator
- .gitignore Generator — Tick your stack — Node, Python, React, Next.js, Docker, macOS, VS Code and 40 more — and get one clean, de-duplicated .gitignore with commented sections, ready to download.
- Git Command Generator — Pick a task like “undo the last commit but keep my changes” or “rename a branch on GitHub”, fill in your branch names and get the exact Git commands — each line explained, risky steps flagged.
- package.json Generator — Fill in a form and get a valid package.json — npm name validation, script presets for Vite, Next.js, Node and TypeScript libraries, exports, engines, license and repository — with warnings for common mistakes.
- .env File Validator — Paste a .env file to find invalid keys, duplicates, empty values and quoting mistakes, compare it with .env.example to spot missing variables, and generate a safe example file.