YAML Validator
Validate YAML syntax against the YAML 1.2 spec.
Related Tools
Format and validate YAML with 2-space or 4-space indentation.
Parse YAML and inspect the resulting document structure.
Validate JSON against a JSON Schema with JSON-pointer error paths.
Convert a docker-compose.yml into Kubernetes Deployment and Service manifests.
Documentation
What is YAML Validator?
YAML Validator checks whether a document parses as valid YAML and, on success, reports structural stats about it — it doesn't show a tree or produce a converted file, just a pass/fail verdict plus a couple of numbers describing the document's shape.
How it works
Clicking Validate (or Cmd/Ctrl+Enter) runs the input through js-yaml's load(). On success, the parsed value is walked recursively to compute two stats: Total Keys, the count of all map keys across the entire document (arrays don't add to this count, only their contents do if they're maps), and Max Depth, the deepest level of nesting reached. On failure, the thrown YAMLException's mark supplies an exact line and column, shown in the result panel and highlighted directly in the input gutter.
Features
- Full YAML 1.2-compatible validation via js-yaml
- Exact line/column error location on failure
- Total Keys and Max Depth stats on success
- Character count of the current input
- Load a .yaml/.yml file directly from disk
Example
Input:
name: DevFormats valid: true tools: - json-formatter - yaml-formatter
Output: ✓ Valid YAML, with Total Keys: 2 (name, valid — the tools array's string entries aren't keys) and Max Depth: 2 (the top-level map, then the tools array's items).
Common errors
Mixing tabs and spaces for indentation is the most common failure — YAML requires consistent spaces because indentation itself carries structural meaning, unlike JSON or XML where whitespace is cosmetic. Inconsistent list-item indentation relative to its parent key, and an unclosed quoted string, are the other frequent causes, both reported with an exact line and column.
Best practices
Run this validator in CI or a pre-commit hook against config files before they're deployed — a syntactically invalid YAML file that reaches a deploy step tends to fail with a much less specific error than the line/column this tool reports up front.
Frequently Asked Questions
What does this check?▾
It parses your YAML against the YAML 1.2 specification and reports whether it's syntactically valid, with the exact line and column of any error.
What are "Total Keys" and "Max Depth"?▾
On valid input, the total number of map keys across the whole document and the deepest level of nesting — the same stats the JSON Validator reports, adapted for YAML.
What's the most common YAML mistake?▾
Mixing tabs and spaces for indentation — YAML requires consistent spaces, since indentation itself carries structural meaning.
Is my YAML uploaded anywhere?▾
No — validation runs entirely in your browser via js-yaml.