YAML Validator

Validate YAML syntax and catch duplicate keys, tab indentation, and multi-document errors with line/column detail — then fix them with one click.

YAML Input
Loading editor…

Related Tools

Learn more about the YAML Validator

What is YAML Validation?

YAML validation checks whether a document follows correct YAML syntax and flags the structural mistakes that syntax checking alone misses — duplicate mapping keys and tab characters used for indentation. Since YAML relies on whitespace rather than brackets to express structure, small indentation mistakes are the most common way a document silently changes meaning or fails to parse.

Unlike a YAML formatter, which re-indents already-valid YAML, a YAML validator checks correctness without changing your data. It reports every problem it finds — the parser's own syntax error, any duplicate keys, and any tab-indented lines — each with a precise line and column, so you can fix every issue in one pass instead of hitting them one at a time.

This is especially useful for YAML that a parser will happily accept but that doesn't mean what you think: when the same key appears twice in a mapping, most YAML libraries silently keep only the last value and discard the first, with no warning. This tool catches that case explicitly, alongside real syntax errors and indentation problems.

This page lets you validate YAML online for free, directly in your browser. Paste any YAML — or drag and drop a .yaml/.yml file — and click Validate to get a pass/fail result with a full, line-numbered list of every issue found. When something is wrong, click Fix Issues to fix duplicate keys and tab indentation automatically, without leaving the page. Everything runs locally; your YAML is never sent to a server.

Automatically Fix YAML Issues

Finding an issue is only half the job — this validator can fix the mechanical ones for you. After validating, a Fix Issues button appears next to Download Report whenever the file has at least one auto-fixable problem. Click it to reveal a fix action next to each duplicate-key or tab-indentation issue in the list.

Duplicate Key → Remove Line

Deletes the repeated key, keeping the first occurrence — the value you originally intended, not whichever one a parser would silently keep.

Tab Indentation → Fix Tabs

Converts the leading tab characters on that line to spaces, resolving both the indentation issue and the syntax error it usually causes.

Fix All

Applies every automatic fix across the whole file — including every document in a multi-document file — in a single click, then re-validates.

Syntax errors — an unclosed bracket, a bad colon, invalid nesting — aren't offered a fix button, since there's no single safe way to guess what was intended. Those are marked Manual fix in the issue list so you know exactly which lines still need a look. Every fix re-validates the document immediately, so you can keep clicking Fix All until only manual issues remain.

Why Validate YAML?

Catch Broken Manifests Before Deploy

A single misindented line in a Kubernetes manifest or CI workflow can silently break a deploy. Validating first catches it before it reaches a pipeline.

Avoid Silent Data Loss

Duplicate keys in a YAML mapping are not a syntax error to most parsers — the earlier key is silently discarded. This is easy to introduce by copy-pasting config blocks and easy to miss by eye.

Fix the #1 YAML Footgun

Mixing tabs and spaces in indentation is invalid YAML and the most common cause of confusing parser errors. This validator points to the exact tab character causing the problem — and can fix it for you.

Review Multi-Document Files

Kubernetes manifests and CI configs often bundle several resources in one file separated by ---. Each document is validated on its own, so one broken document does not hide errors in the others.

Example

Here's valid YAML alongside the same mapping with a duplicate key — a mistake most parsers accept silently but this validator flags explicitly.

Valid YAML
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  labels:
    app: web
spec:
  replicas: 3
  template:
    spec:
      containers:
        - name: web
          image: nginx:1.25
          ports:
            - containerPort: 80
Invalid YAML (duplicate key)
user:
  id: 42
  name: Jane Doe
  email: jane@example.com
  id: 43

Features

Validate Syntax

Parse YAML and surface every syntax error with its exact line and column.

Duplicate Key Detection

Catch repeated mapping keys explicitly, since YAML parsers silently keep only the last one by default.

Tab Indentation Check

Flag tab characters used for indentation — YAML's most common footgun.

One-Click Auto-Fix

Remove duplicate keys and convert tabs to spaces automatically, one issue at a time or all at once.

Multi-Document Support

Validate every ---separated document in a file independently and report issues for each.

Upload a File

Drag and drop or upload a .yaml/.yml file to validate it directly.

Copy / Download Report

Export the full list of issues as a report you can share or attach to a PR.

How to use

Paste your input in the left editor. The output appears automatically on the right. Use the toolbar buttons to copy, download, or transform the result.

  1. Paste or type your content in the input editor on the left.
  2. The formatted output is generated automatically.
  3. Use Copy, Download, or other actions from the output toolbar.
  4. Click the expand icon to view the output in fullscreen.
FAQ

Is this YAML validator free?

Yes, the YAML validator is completely free to use with no limits, signup, or account required.

Is my YAML uploaded to a server?

No. All validation and fixing happens entirely in your browser using JavaScript. Your YAML is never uploaded or sent to a server.

Does this tool detect duplicate keys?

Yes. Most YAML parsers silently keep only the last value when a key is repeated in a mapping. This validator explicitly checks for duplicate keys and reports the exact line and column of each one.

Does it catch tab-vs-space indentation errors?

Yes. YAML indentation must use spaces, not tabs. Any tab character found in a line’s indentation is flagged separately from other syntax errors, since it is the most common cause of confusing YAML failures.

Can it fix the issues it finds, or just report them?

Both. Click "Fix Issues" on any invalid result to reveal a fix action for each duplicate key or tab-indentation issue — "Remove Line" deletes the duplicate (keeping the first occurrence), "Fix Tabs" converts tabs to spaces. "Fix All" applies every automatic fix in one click and re-validates instantly. Syntax errors are too varied to auto-fix safely, so those are flagged for a manual edit.

If I fix a duplicate key, which value does it keep?

The first occurrence. Later duplicates of the same key are removed, matching what most people intended when they originally wrote the key — not the last-value-wins behavior YAML parsers use by default.

Does it support multi-document YAML files?

Yes. Files with multiple ---separated documents, such as Kubernetes manifests bundling several resources, are validated one document at a time so an error in one does not hide errors in the others. Fix All applies across every document in the file.

What information does the validation report include?

Every issue found — syntax errors, duplicate keys, and tab indentation — is listed with its document number, line, column, and a human-readable message. You can copy or download the full report.

What is the difference between this and the YAML Formatter?

The YAML Formatter re-indents already-valid YAML and surfaces a single syntax error if parsing fails. The YAML Validator checks correctness only, reports every issue in one pass — including duplicate keys and tab indentation a plain parser check would miss — and can fix the fixable ones for you.