Code Beautifier

YAML Validator

Validate YAML syntax with exact line and column errors, multi-document support, and warnings for values YAML 1.1 parsers read differently.

Draft saved locally.

Local workspace

Named projects in IndexedDB · Local only — never synced to our servers. Worksp

Open manager

Batch workspace

Format multiple files locally in one run.

yaml
json

Most YAML bugs are invisible: the file parses, but a value means something else. YAML 1.2 parsers read COUNTRY_CODE: NO as text, while YAML 1.1 parsers, still common in Python tooling and older deployment systems, read it as false, turn 22:22 into 1342 and 0644 into 420, and even turn the on: key of a GitHub Actions workflow into true. This validator reports syntax errors with the exact line and column, handles multi-document files, and compares every key and value under both YAML versions so you know which ones to quote. Use YAML to JSON to inspect the parsed structure.

Common errors and fixes

bad indentation of a mapping entry

Align sibling keys with the same number of spaces, and indent children further than their parent.

duplicated mapping key

A key appears twice in the same mapping. Rename one, or merge their values.

end of the stream or a document separator is expected

Content starts where a new key was expected, often a value that continues on an unindented line. Indent it or quote the value.

tab characters must not be used in indentation

Replace tabs with spaces. Most editors can convert indentation to spaces automatically.

Options

OptionDescription
Warn about YAML 1.1 differencesParses the file a second time the way YAML 1.1 tools do (PyYAML, older Docker Compose) and lists every key or value that would change type, such as NO becoming false.

FAQ

What does 'bad indentation of a mapping entry' mean?

A key is indented differently from its siblings, or a child isn't indented further than its parent. Line up keys at the same level with the same number of spaces.

Why do NO, on, and 22:22 mean different things in different YAML tools?

YAML 1.2 treats them as strings, but YAML 1.1 parsers read NO and on as booleans and 22:22 as the number 1342. That's why the on: key of a GitHub Actions workflow becomes true in PyYAML. With YAML 1.1 warnings on, the validator lists every key and value that changes.

Can I validate a file with several YAML documents?

Yes. Each document separated by --- is parsed, the report counts them, and errors point at the line in the full file.

Does the validator check Kubernetes or GitHub Actions fields?

No. It checks YAML syntax and how values are typed. Use the Kubernetes Manifest and GitHub Actions tools for schema-level checks.

Can I indent YAML with tabs?

No. The YAML spec forbids tab characters in indentation. Replace them with spaces; the validator reports the exact line.