Input

Validation Results

Enter or paste your YAML to validate

What is a YAML Validator?

YAML fails in a way JSON does not: the file looks right. Braces and brackets are visible, so a broken JSON document usually looks broken. YAML encodes structure in whitespace, so a document that is off by one space — or indented with a tab that renders as eight — looks perfectly aligned in your editor and still gets rejected by the parser. This page is the fast way to settle it: paste the document, and you get either a green result with statistics or the exact line, column, and reason it failed.

Validation runs on js-yaml, which implements the YAML 1.2 specification — the same parser behind most JavaScript tooling that reads YAML. Everything happens in your browser tab. Kubernetes secrets, database passwords, and API keys live in YAML files more often than anywhere else, so it matters that nothing here is uploaded, cached, or logged.

One limit worth stating up front, because a lot of tools are vague about it. There are two different questions you can ask about a YAML file. Is it well-formed? — does it parse at all. Is it correct? — does it have the keys, types, and values that Kubernetes, GitHub Actions, or Ansible actually require. This tool answers the first question only. A manifest with replcias: 3 instead of replicas: 3 is flawless YAML and a broken deployment. For the second question you need a schema validator such as JSON Schema or kubeconform, pointed at the schema for your specific tool.

How to Validate YAML

  1. Paste or Upload Your YAMLDrop a manifest, playbook, workflow, or .yml config into the input panel, or use Upload to load a file from disk.
  2. Read the ResultThere is no button. A 300 ms debounce revalidates after you stop typing, so the right panel always describes what is currently in the editor.
  3. Go to the Reported LineOn failure you get a line and column, and the offending line is highlighted in the editor. YAML errors are frequently reported one line after the real mistake — the parser only notices when the next line contradicts it — so if the flagged line looks fine, check the line above.
  4. Follow the HintTabs and duplicate keys get their own message rather than a generic parse error, because those two account for most real failures and the generic message for them is misleading.
  5. Sanity-Check the StatisticsOn success, check the document count and top-level key count against what you expected. A file you thought was one document showing up as three means a stray ---; four top-level keys where you wrote five usually means two of them merged through bad indentation.

Pro Tip: If your editor inserts hard tabs, no amount of squinting will find the problem — a tab and eight spaces look identical on screen. Set .yaml and .yml to expand tabs to spaces (two per level is the convention) and the entire class of bug disappears. In .editorconfig: [*.{yaml,yml}] then indent_style = space.

Example

A duplicate key. YAML mappings cannot hold the same key twice, and js-yaml refuses the document rather than silently keeping the last value — which is the right call, because "silently keeping the last value" is how a merged config quietly drops a setting. The validator names the key and points at the second occurrence.

Invalid YAML → Validation error Validate
subscriber.yamlInvalid · 1 error
# merged from two branches
subscriber:
  subscriberId: SUB-1001
  plan: Unlimited 5G
  roaming: true
  plan: Business 200GB
Validation result1 issue found
✗ Invalid YAML

Line 6, Column 3
Error: The key "plan" appears twice
in the same mapping. YAML requires keys
to be unique within a mapping.

What to do: Delete one of the two
entries, or move it under a different
parent.

Common Use Cases

Checking a Manifest Before It Reaches the Cluster

kubectl apply rejecting a file for a syntax reason is a slow way to find a typo, and in a pipeline it is slower still — you wait for a runner, a checkout, and a failed step to learn that line 42 has a tab in it. Validate here first and you have ruled out the whole class of parse failures in a second. What remains after that is schema-level: field names, required properties, and types, which the Kubernetes object documentation defines.

Debugging a CI Workflow That Will Not Start

A GitHub Actions workflow with a YAML error frequently does not fail loudly — it simply never triggers, and you spend twenty minutes wondering whether the branch filter is wrong. Paste the workflow file here: if it does not parse, that is your answer, and the reported line is where to look.

Auditing a Config Before You Merge It

A pull request that touches a values file, an Ansible playbook, or a Docker Compose file is worth a ten-second check. Beyond parse errors, the statistics catch structural surprises: a document count above one means someone added a ---, and a lower-than-expected top-level key count usually means two blocks merged because one of them lost its indentation.

Key Features

  • Real-Time Validation – Revalidates as you type, with a debounce that keeps large manifests responsive.
  • Exact Line and Column – Every error reports where it happened, corrected to the 1-based numbering your editor's gutter uses.
  • Dedicated Tab Detection – A tab in the indentation is named as a tab, not reported as a downstream indentation error three lines later.
  • Duplicate Key Detection – The repeated key is named and the second occurrence is pointed at, rather than being silently overwritten.
  • Multi-Document Aware – Files split by --- are fully validated and counted, not truncated at the first document.
  • Document Statistics – Size, line count, document count, top-level key count, and maximum nesting depth on every successful parse.
  • Privacy First – Parsing happens in your browser. No upload, no server round-trip, no logs.

Frequently Asked Questions

Why is a tab illegal in YAML indentation?

Because a tab has no defined width. YAML determines structure by counting the indentation of each line, and a tab could stand for 1, 2, 4, or 8 columns depending on who opens the file — so the spec forbids tabs in indentation outright and every conformant parser rejects them. This is the single most common YAML failure, and the reason it hurts is that the file looks correctly aligned in your editor. This page checks the raw text for a leading tab before parsing and tells you which line it is on. Tabs inside a quoted value are fine; only the indentation is the problem.

What counts as a duplicate key, and why is it an error?

Two entries with the same key in the same mapping — often the result of a merge, a copy-paste, or an override added at the bottom of a long file without noticing the original at the top. The spec says keys must be unique. Some parsers quietly keep the last value, which means your config silently loses a setting and nothing tells you; js-yaml throws instead, and this page names the repeated key and points at the second occurrence. Note that the same key at two different nesting levels is not a duplicate — only within one mapping.

What is the Norway problem?

YAML 1.1 treats yes, no, on, off, y, and n as booleans. So country: NO — the ISO code for Norway — parses as false, and a country list quietly drops an entry. YAML 1.2 narrowed booleans to true and false, so this validator (js-yaml, 1.2 core schema) keeps NO as the string it looks like. The catch is that plenty of production parsers still follow 1.1: PyYAML, Ruby's Psych, and older Go libraries all give you false. It is not a syntax error, so no validator will flag it. Quote the value — country: "NO" — and every parser agrees.

Why did my version number change to something else?

Unquoted 1.20 is a float, and the float 1.20 is the number 1.2 — the trailing zero carries no arithmetic meaning. So version: 1.20 becomes 1.2 and your v1.20 release now reads as v1.2. The same trap catches long digit strings: an unquoted 19-digit iccid exceeds JavaScript's safe integer range and loses its last few digits. Again, valid YAML — no validator will flag it. The rule is simple: if a value is an identifier rather than a quantity, quote it.

Is valid JSON also valid YAML?

Yes. YAML 1.2 is a strict superset of JSON, so you can paste a JSON document into the input panel and it will validate. That is not a trick — it is why so many tools accept a single config flag for both formats, and it is handy when you are not sure which of the two a snippet is. The reverse does not hold: most YAML is not valid JSON, and JSON's rules (per RFC 8259) are much narrower.

The reported line looks fine. Where is the actual error?

Look one line up. YAML errors are often detected a line after the mistake, because the parser only discovers that an indentation level is impossible when it reads the next line. A classic case: you forget the space after a colon on line 8, and line 9 gets blamed. The reported position is where parsing became impossible, not necessarily where you typed the wrong character.

Does it handle multi-document files?

Yes. A file split by --- holds several documents, and this page validates all of them and reports the count. If your file shows more documents than you expected, there is a stray --- somewhere — sometimes inside a block scalar where you meant it as text. The statistics sum top-level keys across documents and report the deepest nesting found in any of them.

It says my YAML is valid but my tool still rejects it. Why?

Because valid and correct are different questions. This tool confirms the document parses — nothing more. It cannot know that Kubernetes wants spec.replicas and not spec.replcias, that a port must be an integer, or that your CI provider requires a top-level jobs key. That is schema validation, and it needs the schema for your specific tool. Get the syntax green here first, then run it through a schema validator; debugging both classes of problem at once is how an hour disappears.

Is my data safe?

Yes. Validation runs entirely in your browser with js-yaml. Nothing is uploaded, stored, or logged — which matters more here than on most tools, because YAML files are precisely where connection strings, tokens, and cluster credentials tend to live.

Related Tools

  • YAML Formatter – Re-indent a document once it parses cleanly.
  • YAML to JSON – Convert the validated YAML to JSON for jq, schema checks, or an API body.
  • JSON to YAML – The other direction — turn a JSON payload into readable YAML.
  • YAML to Table – View a validated document as a table to check its shape at a glance.
  • JSON Validator – The same check for JSON, with statistics and precise error positions.

Useful Resources