YAML Validator
Validate YAML 1.2 configuration files in real time. Catches syntax errors, indentation problems, duplicate keys, and bad references — with line and column numbers. Powered by js-yaml, runs entirely in your browser.
Valid vs invalid YAML
YAML cares about indentation. Tabs are not allowed for indenting, and inconsistent spacing breaks the parse. The validator points to the exact line where it gave up.
name: hcodx version: 1 tags: - dev - tools owner: name: Alice
name: hcodx version: 1 tags: - dev - tools owner: name: Alice
What you'll use this for
YAML is everywhere modern infrastructure lives — manifests, pipelines, playbooks, schemas. Validate before you commit.
Kubernetes manifests
Catch indent and quote errors before kubectl apply rejects them.
GitHub Actions
Validate .github/workflows/*.yml before pushing a broken pipeline.
Ansible / Docker compose
Verify playbooks and compose files locally instead of finding errors at run-time.
OpenAPI specs
Quick check that a YAML spec parses before feeding it to a generator.
How to validate YAML
Paste your YAML
Drop it into the left editor. CodeMirror highlights syntax — keys, strings, anchors — as you type.
Click Validate
Or leave auto-validate on for live feedback. js-yaml runs locally — no server.
Read the report
If valid you'll see a tick plus the document parsed as JSON. If invalid you'll see the YAMLException's line, column, and reason.
Fix and re-run
Re-indent, escape, or quote as needed. Auto-validate keeps the report fresh while you type.
Frequently asked questions
Validates against the YAML 1.2 spec, which is the de-facto standard used by Kubernetes, GitHub Actions, and most modern tools. js-yaml 4.x supports 1.2 by default.
Yes. YAML is whitespace-sensitive — inconsistent indentation triggers a YAMLException with the offending line. Tabs are not allowed as indent characters.
Yes. Completely free, no signup, no limits, no ads.
No. js-yaml is loaded once from a CDN; after that everything runs locally. Your data never leaves your device.
No — only syntax (well-formedness). For schema validation, use a tool like Ajv after converting the YAML to JSON.
About this validator
YAML's readability — indentation instead of brackets, no quotes around most strings — is also its biggest source of mistakes. A stray tab, a colon without a space, or an unexpected anchor reference will break the parser. This validator gives you fast, line-precise feedback before the YAML hits Kubernetes, CI, or your config loader.
What it checks
- Indentation — spaces only (no tabs), consistent depth per block.
- Mapping syntax —
key: valuewith a space after the colon. - Strings — quoted (
"..."or'...') and bare; correct escape sequences. - Anchors & aliases —
&namedefines,*namereferences; unknown aliases fail. - Multi-document —
---separators are tolerated; first doc is parsed and reported. - Special values —
true,false,null, dates, numbers per YAML 1.2 schema.
What it doesn't do
- Schema validation. No JSON-Schema / OpenAPI checks here — only syntactic well-formedness.
- Kubernetes-specific rules. A YAML file can be valid YAML but invalid Kubernetes — use
kubectl --dry-runfor that. - Multi-doc loading. Reports the first parse error; subsequent docs aren't validated.