Skip to main content

YAML Validator

Validate YAML structure: tabs, brackets, quotes, mixed sequences, duplicate keys.

Written by Golam Rabbani, Founder & Lead Engineer

Structural checks: tabs, unbalanced brackets/quotes, mixed sequence/mapping at same indent, duplicate keys.

How to use this yaml validator

  1. Paste your YAML document into the input box.
  2. Press Validate to scan for structural issues.
  3. If the document is clean you see a single green confirmation; otherwise each issue is listed with its line number.
  4. Fix the flagged lines in your editor, re-paste, and validate again.
  5. Use Copy report to share the list of issues, or Reset to clear the form.

About this yaml validator

The YAML validator runs the structural checks that account for the vast majority of YAML parse failures in real projects. It flags tab characters used for indentation (YAML forbids them), unbalanced [ ] and { } flow brackets, unterminated single- or double-quoted strings, mappings mixed with sequence entries ("- item") at the same indent level, and duplicate keys inside the same mapping. Each issue is reported with the line number where it was detected so you can jump straight to the problem in your editor.

Because the checks run entirely in your browser, you can paste Kubernetes manifests, GitHub Actions workflows, Docker Compose files, and Ansible playbooks safely. The validator does not require a network round trip or a Python/Ruby runtime, which makes it a fast first stop before reaching for a heavier linter like yamllint.

For example, the input "roles:\n - admin\n editor" produces "Line 3: Sequence \"-\" mixed with mapping keys at the same indent." because the second list item is missing its dash. Add the dash and the validator returns "YAML is structurally valid." on the next run.

FAQ

Does it parse YAML against the full 1.2 spec?
No. It runs the high-value structural checks that catch most real-world mistakes: tabs, brackets, quotes, mixed sequence/mapping, and duplicate keys. For exhaustive spec validation use a dedicated parser like yamllint or libyaml.
Why are tabs flagged as errors?
The YAML 1.2 spec forbids tab characters in indentation. Editors that insert tabs silently are a common source of "could not find expected key" errors at parse time.
What counts as a duplicate key?
Two keys that appear at the same indent level inside the same mapping. Sibling mappings under different parents may reuse the same key without triggering the check.
Will it run against a YAML stream with multiple documents?
Yes. The "---" and "..." document markers are recognised and skipped so each section is validated in turn.
Is my YAML uploaded?
No. Validation runs entirely in your browser.
How do I convert valid YAML to JSON?
Use the YAML to JSON Converter linked below — once the validator gives a clean report, the converter will produce JSON without any parse errors.