โ— runs entirely in your browser

YAML Linter & Formatter

Validate YAML syntax with an exact error line number, and reformat with consistent indentation. Note: reformatting re-serializes the parsed data, so comments are not preserved โ€” for a quick indentation fix on a file with comments, use the error line number to fix it by hand instead.

How it works

Validating a document parses it with js-yaml's load(), which throws a precise line-and-column error the moment it hits invalid syntax; a successful parse is then re-serialized with dump() at your chosen indent width, with line wrapping disabled and keys optionally sorted alphabetically.

FAQ

Why doesn't the formatted output preserve my comments?
Formatting works by parsing your YAML into a JavaScript object and then re-serializing that object from scratch, and comments aren't part of the parsed data model, so they can't survive the round trip.
What does the line and column in an error message actually point to?
The exact position where the YAML parser's grammar broke down, taken directly from the parser's error mark โ€” not necessarily the root cause, which can sit a line or two earlier, such as a missing colon above it.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks โ€” $3