Validate and pretty-print block-style YAML
Supports block-style mappings/sequences, quoted & plain scalars, and JSON-like flow [...]/{...}. Anchors, aliases and multiline block scalars (|, >) aren't supported.
A real YAML parser that checks your YAML is actually valid, reports specific syntax errors with line numbers when it isn't, and re-prints valid YAML with consistent indentation.
Paste your YAML.
Click Validate & Format.
Read the status badge, then copy the result.
Block-style mappings and sequences, quoted and plain scalars, and JSON-like flow-style arrays and
objects ([...] / {...}) are actually parsed into a real structure — not
just checked with a regex — so indentation problems, malformed keys, and structural mistakes are
genuinely caught.
Every error names the exact line number and what went wrong — "Unexpected indentation" means a line's spacing doesn't line up with any valid level in its surrounding structure, and "Expected \"key: value\"" means a line inside a mapping doesn't match that pattern.
Choose 2 or 4 spaces for the re-formatted output. This only affects how valid YAML is re-printed, not how your input is validated.
Block style spreads a structure across multiple indented lines, the way most hand-written YAML looks.
Flow style packs it onto one line using JSON-like brackets, like tags: [a, b, c]. Both are
supported as values, including flow-style nested inside block-style structures.
&name / *name, for reusing a value in multiple places) and
multiline block scalars (| / >, for embedding a multi-line string). Neither
is supported here — YAML using either will fail validation, even though it's valid YAML elsewhere.
Because the YAML specification itself disallows tabs for indentation, not because this tool adds an extra restriction. Pasting tab-indented YAML produces a clear error telling you to switch to spaces.
Only if that file avoids anchors/aliases (&, *) and multiline block scalars (|, >), which are common in exactly those file types. Real-world Kubernetes manifests and Ansible playbooks often use one or both, and this parser will reject them with a syntax error rather than support them.
A line's indentation doesn't line up with any valid level in the surrounding structure, such as being indented one space more or less than its siblings. YAML uses indentation to define nesting, so inconsistent spacing breaks the structure.
Because the YAML specification itself disallows tabs for indentation — this isn't an extra restriction added by this tool, it's a real rule of the YAML format. Use spaces instead.
Yes. JSON-like flow-style arrays and objects are parsed and can appear as values within block-style mappings and sequences.
It's a real parser. Your YAML is actually parsed into a structure, and any syntax problem produces a specific error message with the line number it occurred on, not just a pass/fail guess.
No. Parsing, validating, and formatting all happen entirely in your browser using JavaScript. Nothing you paste here is uploaded anywhere.