YAML Validator
Check YAML syntax as you type and get the exact line, column, and reason a document will not parse
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 follows the YAML 1.2 specification and gives the same verdict as js-yaml, the 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
- Paste or Upload Your YAML – Drop a manifest, playbook, workflow, or
.ymlconfig into the input panel, or use Upload to load a file from disk. - Read the Result – Validation reruns on its own 300 ms after your last keystroke. A green panel with statistics means the whole file parsed; a red one quotes the reason and highlights the line in the editor, and it updates the moment your fix makes the file parse.
- Go to the Reported Line – On 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.
- Follow the Hint – Tabs 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.
- Sanity-Check the Statistics – On 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 this validator 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.
# merged from two branches subscriber: subscriberId: SUB-1001 plan: Unlimited 5G roaming: true plan: Business 200GB
✗ 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
- Checks as you type – Revalidates on every edit, 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.
- Safe for secrets – parsing happens in this tab, so a Secret manifest or a CI file with tokens in it is never uploaded.
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; this page refuses the file instead, 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?
A list such as countries: [NO, SE, DK] passes here with a green result, and that is correct: it is perfectly good syntax. The trouble is what different loaders do with it. Under YAML 1.1, NO, yes, off and the rest are booleans, so PyYAML, Ruby's Psych and older Go libraries read Norway as false; this page applies the 1.2 core schema, as js-yaml does in Node, and keeps the string "NO". A syntax checker has no way to know which of those your deployment uses, so it cannot warn you. Writing "NO" in quotes removes the question.
Why did my version number change to something else?
If you mean the value YAML handed your app, the validator agrees with it: version: 1.20 is a valid float, and floats drop trailing zeros, so the program reading the file sees 1.2. A 19-digit iccid left unquoted is just as valid and just as risky, because any JavaScript loader that turns it into a double rounds the last few digits. Both pass here with a green result, since neither is a syntax error. Quote values that are identifiers rather than quantities and the question never comes up.
Is valid JSON also valid YAML?
Yes. Paste {"imsi": "234150999912345", "cells": [4021, 4022]} and the result is green, with Documents 1, Top-Level Keys 2 and Depth 2, because the 1.2 spec was written so that JSON text loads as YAML. It is a handy way to find out which of the two formats a snippet really is. The reverse does not hold: comments, anchors and indentation-based nesting all fail a JSON parser, whose 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.
Can I check a kubeconfig here without exposing it?
Yes. The check runs inside this tab, and Upload only reads the file into the editor; nothing here creates a share link. Since the right panel shows nothing but counts and an error message, you can validate a kubeconfig or a secrets file without its contents going anywhere. That is also why the YAML Fixer sends people here when they would rather keep a file local.
Related Tools
Useful Resources
- YAML Multiline Strings – A visual cheatsheet for block scalars and the pipe vs folded styles.