YAML Validator

Validate YAML syntax and structure

What is YAML?

YAML (YAML Ain’t Markup Language) is a human-readable data serialization language that has become the de facto standard for configuration files in modern DevOps and software development. Originally released in 2001, YAML was designed to be more readable than XML and simpler than JSON for configuration purposes.

YAML powers Kubernetes manifests, Docker Compose stacks, Ansible playbooks, GitHub Actions workflows, GitLab CI pipelines, CircleCI configs, OpenAPI/Swagger specs, and countless application configuration files. Its reliance on indentation rather than brackets or tags makes it visually clean — but also makes it sensitive to formatting errors that block deploys and break builds.

How to Use the YAML Validator

  1. Paste your YAML content into the input area — a Kubernetes manifest, a .gitlab-ci.yml, a Helm values file, or any YAML document.
  2. Click “Validate” or press Ctrl+Enter to check syntax.
  3. Review any errors reported with line numbers and a short explanation.
  4. Fix the issues and re-validate until the file is clean.

The validator checks the most common YAML issues: tab characters, inconsistent indentation, duplicate keys, malformed key-value pairs, and incorrect list syntax. Everything runs in your browser — no upload, no signup, no waiting.

Common YAML Errors and How to Fix Them

Tab Characters

YAML strictly forbids tab characters for indentation. This is the single most common YAML error:

# Wrong (uses tabs)
server:
	port: 8080

# Correct (uses spaces)
server:
  port: 8080

Configure your editor to use spaces instead of tabs for YAML files. In VS Code, set "editor.insertSpaces": true and "editor.tabSize": 2 for .yml and .yaml files.

Inconsistent Indentation

All items at the same level must use the same number of spaces:

# Wrong
database:
  host: localhost
   port: 5432

# Correct
database:
  host: localhost
  port: 5432

Duplicate Keys

YAML doesn’t allow duplicate keys at the same level. The second value silently overwrites the first, which can cause hard-to-debug issues — especially in Kubernetes manifests where a duplicated name or port field can change deployment behavior in subtle ways:

# Wrong - 'port' appears twice
server:
  port: 8080
  host: localhost
  port: 3000

Missing Colon in Key-Value Pairs

Every key must be followed by a colon and a space:

# Wrong
name John

# Correct
name: John

Validating CI/CD YAML — GitLab CI, GitHub Actions, CircleCI

CI/CD pipeline files are where YAML errors hurt the most: a single bad indent in .gitlab-ci.yml or .github/workflows/deploy.yml means a wasted commit, a failed pipeline run, and a few minutes of waiting just to learn you forgot a colon.

Paste your pipeline file into this validator before you push:

  • GitLab CI (.gitlab-ci.yml) — catches syntax errors before GitLab’s own runner does. For full schema validation against GitLab keywords (stages, script, rules, needs, extends), use GitLab’s built-in CI Lint at <your-project>/-/ci/lint. The two together — syntax here, schema there — give you near-zero failed-pipeline noise.
  • GitHub Actions (.github/workflows/*.yml) — most failures are indentation under jobs: or steps:. Validate first, then trust GitHub Actions to surface anything more semantic when it runs.
  • CircleCI (.circleci/config.yml) — same pattern. Run a syntax check here, then circleci config validate locally for the schema layer.
  • Bitbucket Pipelines, Drone CI, Argo Workflows — all standard YAML, all validated the same way.

The principle: every modern pipeline tool layers schema rules on top of YAML, but they all assume the YAML itself parses. Catching syntax errors locally cuts the feedback loop from “push and wait 90 seconds” to “Ctrl+Enter, fix, push once”.

Validating Kubernetes Manifests and Helm Charts

Kubernetes is YAML’s most demanding home. A misindented field in a Deployment manifest can silently change the behavior of an entire cluster, and the error you eventually see from kubectl apply rarely points at the real cause.

Use this validator as the first step before any kubectl apply:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
        - name: my-app
          image: my-app:1.0.0
          ports:
            - containerPort: 8080

For Helm charts, validate Chart.yaml, values.yaml, and any templates/*.yaml (after rendering — helm template my-release ./chart). For kustomization.yaml, the same rules apply.

After syntax passes here, layer on schema validation:

  • kubectl apply --dry-run=client -f file.yaml — catches schema issues without touching the cluster.
  • kubectl apply --dry-run=server -f file.yaml — adds admission-controller checks (RBAC, validating webhooks, OPA policies).
  • kubeval, kubeconform, or kube-linter for offline schema validation against specific Kubernetes versions.

Each tool checks a different layer. This validator covers the bottom layer — the YAML itself — and runs in your browser, so cluster credentials never leave your machine.

YAML Validator vs yamllint (CLI)

yamllint is the canonical Python CLI tool for YAML checking and is what most teams add to CI. The two tools have different roles:

This online validatoryamllint (CLI)
SetupNone — open the pagepip install yamllint
Syntax errors
Style rules (line length, spacing, document markers)BasicConfigurable, strict
Custom rule filesNo.yamllint config
Best forQuick one-off checks, paste-and-goCI/CD pipelines, team-wide enforcement
PrivacyRuns entirely in your browserRuns locally

Use this validator when you want an answer in three seconds. Add yamllint to your CI when you want consistent style across a team. They’re complementary, not alternatives — many developers use both daily.

YAML vs JSON

FeatureYAMLJSON
ReadabilityMore readableMore verbose
CommentsSupported (#)Not supported
IndentationSignificantNot significant
Data typesAuto-detectedExplicit
Trailing commasNot applicableNot allowed
Multi-line stringsNative supportRequires \n

YAML is generally preferred for configuration files that humans edit frequently, while JSON is better suited for data exchange between systems and APIs. Many tools accept both formats, and you can convert between them with a JSON ↔ YAML converter.

YAML Best Practices

Use Consistent Indentation

Pick 2 spaces per level (the most common convention) and stick with it throughout your project. Configure your editor and linter to enforce this.

Quote Strings When Ambiguous

YAML auto-detects types, which can cause surprises. Values like yes, no, true, false, null, 1.0, and 3:00 are interpreted as booleans, null, floats, or sexagesimal numbers:

# Dangerous - interpreted as boolean true
country: Norway
uses_yaml: yes

# Safe - explicitly a string
country: "Norway"
uses_yaml: "yes"

This is known as the Norway problem: country code NO becomes the boolean false in older YAML 1.1 parsers. Modern YAML 1.2 fixed many of these, but most tools (including some Kubernetes tooling) still target 1.1 quirks.

Use Linting in CI/CD

Add YAML linting to your CI/CD pipeline using yamllint or a similar tool. This catches formatting issues before they reach production. A misconfigured YAML file in Kubernetes or Docker Compose can cause an entire deploy to fail or, worse, succeed in unexpected ways.

Validate Before Deploying

Always validate YAML configuration files before applying them to production systems. This online validator gives you instant feedback for one-off checks; for automated workflows, integrate a YAML linting step into your build pipeline. The combination — pre-commit checks locally, CI enforcement on every push — eliminates almost all YAML-related deploy failures.

Frequently Asked Questions

What is YAML?

YAML (YAML Ain't Markup Language) is a human-readable data serialization format commonly used for configuration files, deployment manifests, and data exchange. It uses indentation to represent structure, making it cleaner and more readable than JSON or XML for configuration purposes.

Why does my YAML fail validation?

Common YAML errors include using tabs instead of spaces for indentation (YAML only allows spaces), inconsistent indentation levels, duplicate keys at the same nesting level, missing colons after keys, and incorrect list syntax. This validator reports the specific error and line number so you can fix the issue without guesswork.

Can I use tabs in YAML?

No. The YAML specification explicitly forbids tab characters for indentation. You must use spaces only. Most code editors can be configured to insert spaces when you press the Tab key. This is the most common source of YAML validation errors.

What indentation should I use in YAML?

YAML allows any number of spaces for indentation, but you must be consistent within each level. The most common convention is 2 spaces per indent level. Some projects use 4 spaces. Whatever you choose, be consistent throughout the entire file.

Can I validate GitLab CI YAML files here?

Yes. Paste the contents of your `.gitlab-ci.yml` and the validator will catch syntax errors — wrong indentation, duplicate stage keys, missing colons, tab characters. It checks pure YAML syntax only; for GitLab-specific schema validation (allowed keywords, job dependencies, includes), use GitLab's own CI Lint tool inside your project. Most failures developers hit on push are syntax-level, which this tool catches in seconds.

Does this validator work for Kubernetes manifests?

Yes. Kubernetes manifests, Helm charts, and `kustomization.yaml` files are all YAML and validate the same way. The validator confirms the YAML is syntactically correct and parseable. For Kubernetes-specific schema checks (apiVersion, kind, required fields), pair it with `kubectl apply --dry-run=client -f file.yaml` after the syntax check passes.

How does this compare to yamllint command-line?

yamllint is a Python CLI tool that does both syntax checking and style linting (line length, document markers, indent rules). This online validator focuses on the most common syntax errors and runs instantly without installing anything. Use this for quick checks; integrate yamllint into your CI pipeline for enforced style rules across a team.

Can I check GitHub Actions workflow files?

Yes. `.github/workflows/*.yml` files are standard YAML, so the validator catches indentation, tab, and structural errors before you commit. For schema validation (valid `runs-on` values, action references, job needs), GitHub Actions itself reports those when the workflow runs — but catching syntax issues here saves a wasted commit-push cycle.

Is my YAML data safe with this tool?

Yes. All processing happens entirely in your browser using JavaScript. Your YAML data is never sent to any server, never logged, and never leaves your machine — important when you're pasting CI configs, Kubernetes secrets, or anything else with infrastructure details.