YAML Validator and Parser

Check YAML syntax, find the exact line and column of an error, see how a YAML parser reads your file as JSON, and format valid YAML. Your content stays in this browser.

Free online YAML validator

Validate YAML configuration files without installing a linter. The checker parses your document with js-yaml (YAML 1.2 core schema) and either confirms it is valid or reports the parser error with the line and column, the offending line and a caret under the character where parsing stopped. Every document in a multi-document file is checked.

YAML parser: see the parsed value

The Parse to JSON view is a YAML parser online: it shows exactly what a program will receive after loading your file. Keys, nesting, lists, numbers, booleans and nulls are made explicit, anchors (&base) and aliases (*base) and merge keys (<<: *base) are expanded, and block scalars (| and >) are shown as the final strings. Values are typed the way a real parser types them — age: 36 is the number 36, not the string "36".

name: Ada            ->  { "name": "Ada",
age: 36                    "age": 36,
admin: true                "admin": true,
tags: [a, b]               "tags": ["a", "b"] }

To convert YAML into a file you keep — JSON, XML or CSV — use the YAML to JSON converter.

Common YAML errors

ErrorCauseFix
bad indentation of a mapping entryA key is indented more or less than its siblings.Align keys at the same level with the same number of spaces.
tab characters must not be used in indentationA tab in the leading whitespace.Indent with spaces only.
duplicated mapping keyThe same key twice in one mapping.Remove or rename one; most parsers would silently keep the last.
end of the stream or a document separator is expectedText after a value that cannot continue it, often a missing - or colon.Check the line above the reported one.
incomplete explicit mapping pair; a key node is missedAn unquoted value starting with :, ? or similar.Quote the value.
unidentified alias*name used before or without &name.Define the anchor first.

Type gotchas a validator will not flag

Valid YAML can still mean something different from what you intended. YAML 1.1 tools (PyYAML, older Ruby, many CI systems) read yes, no, on and off as booleans, so the country code NO becomes false. version: 1.10 becomes the number 1.1, and a leading-zero ZIP code like 01234 may become 1234 or an octal number. Check the Parse to JSON view and quote anything that must stay a string.

Common use cases

Common questions

How do I validate YAML online?

Paste the YAML or open a .yaml or .yml file. The validator parses it as you type and either confirms it is valid or shows the error message with its line and column and a caret under the problem. Fix the line and the check reruns.

What does the YAML parser output show?

The Parse to JSON view shows exactly how a YAML parser reads your file, as JSON: which values became numbers or booleans, how anchors and aliases were expanded, and how multi-line strings were folded. It is the quickest way to spot values like no or 1.0 that are not the strings you meant.

Why is my YAML invalid when it looks fine?

The usual causes are a tab used for indentation (YAML only allows spaces), inconsistent indentation inside a list or mapping, a missing space after a colon, an unquoted value that starts with a special character such as : { [ * & or %, and duplicate keys in the same mapping.

Can it format valid YAML?

Yes. The Format YAML view re-serialises the parsed document with two-space indentation. Comments are not kept, because a YAML parser discards them, so copy the formatted output only when you do not need the comments.

Does it support multiple documents in one file?

Yes. Documents separated by --- lines, as in Kubernetes manifests, are each validated. The parsed JSON view shows them as an array, one element per document.

Does the YAML validator upload my file?

No. YAML is parsed locally in your browser with the js-yaml library. Nothing is uploaded.