Free YAML Validator & Formatter Online
Validate YAML and get the exact line of any error — a tab in indentation, a duplicate key, or a bad dedent — across GitHub Actions, Kubernetes, Docker Compose, and Ansible files. Re-format with 2-space indent and convert to JSON, all 100% in your browser.
Line-Precise Errors
When something is wrong, we tell you exactly which line and exactly what — tab in indentation, duplicate key, unexpected dedent, missing colon. No "syntax error" mystery messages.
Round-Trip Formatting
Parse to a structured tree, then re-emit clean YAML with consistent 2-space indent. Strip out trailing whitespace, normalize quote styles, and lock in formatting before you commit.
Catches the Norway Problem
YAML 1.1 famously turns `no` and `off` into booleans. We surface what your strings parsed as so you can quote them before a multi-million-row config file sets every country code wrong.
100% Client-Side
Parsing happens in your browser. Kubernetes secrets, deploy keys, Ansible vaults — paste them with confidence. Your YAML never reaches our servers, ever.
Free Online YAML Validator & Formatter
A YAML validator checks that a YAML document parses cleanly and reports the exact line where it breaks. Paste a GitHub Actions workflow, Kubernetes manifest, Docker Compose file, or Ansible playbook, and this tool either confirms it is valid or returns one line-precise error — a tab in indentation, a duplicate key, or an unexpected dedent. It also re-formats with 2-space indent and converts YAML to JSON. Everything runs 100% in your browser, free.
How to validate YAML
- Paste your YAML into the input box, or press Sample to load a real GitHub Actions workflow.
- Keep the Validate tab selected to check syntax — the result updates the instant you stop typing.
- Read the result: a green "YAML is syntactically valid" banner, or a single red error naming the exact line and reason.
- Switch to Format YAML to re-emit the document with consistent 2-space indentation so diffs show logic, not whitespace.
- Switch to Convert to JSON to see the parsed structure, then Copy or Download the output.
What is YAML and how does validation work?
YAML ("YAML Ain't Markup Language") is a human-readable data serialization format that uses indentation instead of braces to express hierarchy. It is the default config language for Kubernetes, GitHub Actions, Docker Compose, Ansible, GitLab CI, and AWS CloudFormation. The current spec is YAML 1.2.2 (October 2021), which made YAML a strict superset of JSON — every valid JSON document is also valid YAML.
This validator is a pragmatic YAML 1.2-subset parser. It walks the document line by line, tracking indentation depth to build the tree, and stops at the first structural problem with a clear message. It validates block mappings, block sequences, plain and quoted scalars, block scalars (| and >), comments, and the --- document separator. It deliberately rejects anchors (&), aliases (*), tags (!!str), and flow style ([a, b], {a: 1}) with an explicit error rather than half-parsing them.
"To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently."— YAML 1.2.2 specification, §6.1 Indentation Spaces
Worked examples: input → result
Valid · nested mapping
server: host: localhost port: 8080
Result: YAML is syntactically valid.
Invalid · tab in indentation
jobs: test: # leading tab, not spaces
Result: Line 2: YAML forbids tab characters in indentation — use spaces only.
Invalid · duplicate key
name: build name: deploy
Result: Line 2: Duplicate key "name" in mapping.
Edge case · the Norway problem
country: NO feature_flag: off
In a YAML 1.1 parser (PyYAML, js-yaml defaults), NO becomes the boolean false and off becomes false too — the famous Norway bug. This validator follows YAML 1.2, so both stay strings. To be safe in every parser, quote them: country: "NO".
YAML scalar type inference reference
These are the exact rules this validator uses to type an unquoted scalar. Anything that does not match a rule below stays a string. Quote a value to force it to a string regardless of its shape.
| Input | Parsed type | Note |
|---|---|---|
| true / True / TRUE | boolean | Only these three spellings; yes/on stay strings (YAML 1.2) |
| null / ~ / (empty) | null | An empty value after a key also becomes null |
| 42 | integer | Only if it fits a safe integer (≤ 2^53 − 1) |
| 3.14 | float | Leading or trailing decimal accepted |
| NO / yes / off | string | Avoids the Norway problem; quote anyway for 1.1 parsers |
| 90210000000000000000 | string | Too large for a safe integer, so kept verbatim — no precision loss |
The duplicate-key rule most validators get wrong
The YAML 1.2 spec calls duplicate mapping keys "implementation-defined", so most parsers silently keep the last value and throw the first away — a bug that hides until production. This validator instead hard-fails with Line N: Duplicate key, refusing to parse. It is the one place we are intentionally stricter than the reference parsers, because a silently dropped jobs: or env: block is exactly the kind of error that ships to a cluster unnoticed.
Two more deliberate guards: large integers like a 20-digit ID stay strings rather than losing precision past 2^53, and anchors, aliases, and tags raise an explicit error instead of being half-parsed. If you need full YAML 1.2 with anchors and flow style, run js-yaml server-side — this tool trades completeness for never corrupting your data quietly.
Runs 100% in your browser
Your YAML never leaves your device. Validation, formatting, and JSON conversion all run locally in JavaScript — no uploads — so Kubernetes secrets and Ansible vault references stay private and the tool works offline once loaded. I tested it against real GitHub Actions workflows, Docker Compose files, and Kubernetes manifests, plus deliberate breakages: a tab on line 2, a duplicate name: key, an unquoted NO, and a flow-style array. Each returned the exact line and reason rather than a vague "could not find expected key".
Frequently asked questions
Is this YAML validator free to use?
Yes — 100% free with no signup and no usage cap. Validate, re-format, and convert YAML to JSON as often as you need.
Does my YAML get uploaded anywhere?
No. Parsing, validation, and conversion all happen in your browser with JavaScript. Nothing is sent to a server, so the tool runs offline once the page loads.
What is the Norway problem?
A YAML 1.1 bug where unquoted yes, no, on, and off coerce to booleans, so the country code NO becomes false. This validator follows YAML 1.2, so they stay strings — but quote them anyway for parsers that default to 1.1.
Why does YAML forbid tabs?
Editors render tabs at different widths, which would silently change how a document nests across systems. The spec bans tabs in indentation, and this validator rejects any line starting with one, naming the line number.
Related data & config tools
Translate between YAML and JSON both ways
JSON FormatterPretty-print & validate the JSON you convert to
JSON DiffCompare two configs after converting to JSON
JSON Schema GeneratorDerive a schema from your parsed config
JSON to TypeScriptGenerate typed interfaces from config data
CSV to JSON ConverterReshape tabular exports into JSON
XML FormatterPretty-print the third major config format
SQL FormatterTidy queries that feed your data pipeline
Cron Expression BuilderValidate schedules embedded in your YAML
Base64 EncoderEncode secrets referenced in Kubernetes YAML
Guide: JSON vs YAML vs XMLWhen to choose each data format
Guide: JSON ValidationDeep dive on validating structured data
All ToolsBrowse the full Toolk utility hub
Last updated: June 2, 2026 · Runs 100% in your browser — no uploads, nothing leaves your device.
Need a different tool?
Browse all 89 free, in-browser tools — or tell us what we should build next.