Validate YAML
Validate YAML syntax and structure. Detects errors with line numbers and helpful messages. 100% client-side.
Paste any YAML — Kubernetes manifests, Docker Compose files, CI workflows — and get instant syntax checking with exact line numbers for errors. And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser walks through every line of your YAML, checking indentation levels, colon placement, quote matching, and data types. If it hits a problem, it stops and reports the line number plus a human-readable description. Valid YAML gets a breakdown of its structure — root type, number of keys or items, and how many documents the file contains.
Examples
Docker Compose Service
Quick check on a basic service definition before running docker compose up.
version: "3.8"
services:
web:
image: nginx:latest
ports:
- "80:80"
✔ Valid YAML
Root type: object
Top-level keys: 2
Documents: 1
Indentation Error in GitHub Actions Workflow
Tabs snuck into a workflow file. The YAML spec only allows spaces, so this breaks every time.
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
✘ Error at line 4
"bad indentation of a
mapping entry"
Multi-Document Kubernetes Manifest
A single file with a Deployment and Service separated by the --- document marker. The validator counts both.
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
---
apiVersion: v1
kind: Service
metadata:
name: my-app-svc
✔ Valid YAML
Root type: object
Top-level keys: 3
Documents: 2
Who Uses This
Checking Kubernetes manifests, Helm charts, and Ansible playbooks before deploying to production.
Validating Docker Compose files and Spring Boot application.yml configs during local development.
Debugging GitHub Actions, GitLab CI, or CircleCI workflow files that suddenly stopped running.
Learning YAML syntax for the first time and needing instant feedback on what went wrong with their formatting.
Common Mistakes
YAML flat-out rejects tabs for indentation. Your editor might show them the same way, but the parser won’t. Switch your editor to "spaces only" mode — two spaces per level is the standard.
Values like password: p@ss:word! break because colons and special chars have meaning in YAML. Wrap them in quotes: password: "p@ss:word!". Same goes for strings starting with *, &, or {.
Mixing 2-space and 4-space indentation in the same file confuses the parser. Pick one and stick with it. Most tools expect 2 spaces, but the key is consistency.
YAML 1.1 parses enabled: yes as a boolean true, not the string "yes." If you actually need the word, quote it: enabled: "yes". This trips up country codes too — NO for Norway becomes false.
Technical Details
- Processing: 100% client-side via js-yaml library
- YAML Spec: YAML 1.2 (with 1.1 compatibility)
- Multi-Document: Full support for --- separated documents
- Browser Support: Chrome, Firefox, Safari, Edge
- Max Input: Limited only by browser memory
Frequently Asked Questions
How do I fix "bad indentation" errors in YAML?
Nine times out of ten, it’s tabs. Open the file in an editor that shows invisible characters and replace any tabs with spaces. If it’s not tabs, check that child elements are indented further than their parents — YAML is strict about this. Two spaces per level is standard.
Can I validate YAML with multiple documents in one file?
Yes. Separate documents with --- on its own line. The validator parses each one individually and reports the total document count. If any single document has an error, you’ll see which one failed.
Is YAML validation the same as JSON validation?
Not really. YAML is a superset of JSON, so all valid JSON is valid YAML — but not the other way around. YAML uses indentation instead of braces, supports comments, and has features like anchors and aliases that JSON doesn’t. A YAML validator checks for these YAML-specific rules.
Why does my YAML file work locally but fail in CI/CD?
Usually it is an encoding issue or invisible characters. Windows line endings (CRLF) can cause problems in Linux-based CI environments. Also check for trailing whitespace or BOM characters at the start of the file. Paste it here to see if the parser catches something your local tool missed.
Does this tool upload my YAML data anywhere?
No. The entire validation happens in your browser using JavaScript. Nothing gets sent to a server. You can even disconnect from the internet after the page loads and it’ll still work. Safe for configs with secrets or credentials.