Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Validate YAML

Validate YAML syntax and structure. Detects errors with line numbers and helpful messages. 100% client-side.

Your files never leave your browser
YAML Input0 chars, 0 lines
Ready·

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

Paste YAML
➔
js-yaml Parser
➔
Syntax Report

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.

INPUT
version: "3.8" services: web: image: nginx:latest ports: - "80:80"
OUTPUT
✔ 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.

INPUT
name: CI on: push jobs: build: runs-on: ubuntu-latest
OUTPUT
✘ 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.

INPUT
apiVersion: apps/v1 kind: Deployment metadata: name: my-app --- apiVersion: v1 kind: Service metadata: name: my-app-svc
OUTPUT
✔ Valid YAML Root type: object Top-level keys: 3 Documents: 2

Who Uses This

💻 DevOps Engineers

Checking Kubernetes manifests, Helm charts, and Ansible playbooks before deploying to production.

👨‍💻 Backend Developers

Validating Docker Compose files and Spring Boot application.yml configs during local development.

⚙️ CI/CD Engineers

Debugging GitHub Actions, GitLab CI, or CircleCI workflow files that suddenly stopped running.

📚 Students

Learning YAML syntax for the first time and needing instant feedback on what went wrong with their formatting.

Common Mistakes

Using tabs instead of spaces

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.

Forgetting to quote strings with special characters

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 {.

Inconsistent indentation levels

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.

Treating "yes" and "no" as strings

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

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.

Share: