YAML Prettier - Format, Validate and Beautify YAML Online
YAML is the configuration language of modern infrastructure. Kubernetes manifests, GitHub Actions workflows, docker-compose.yml, Ansible playbooks, GitLab CI pipelines, OpenAPI specifications, Helm values files and Home Assistant configs are all YAML, which means developers read and write far more of it than they ever intended to. It is also uniquely unforgiving: whitespace carries meaning, so a single stray tab, a mis-aligned dash or a key indented two spaces too far turns a working manifest into a parse error - and the error usually points at a line some distance from the actual mistake.
This YAML formatter parses your document into a node tree that keeps every comment, anchor and source position, applies the style you choose, and re-prints the whole thing from that tree. Because the output is generated from the parsed structure rather than by patching whitespace, indentation, quoting and block style come out consistent no matter how the input was written.
What the formatter fixes
Beautify mode normalises indentation to your chosen width, repairs runaway nesting, explodes flow collections such as {push: {branches: [main]}} into readable block style, tidies comment placement, strips trailing whitespace and collapses runs of blank lines. Minify mode does the opposite, collapsing the document to compact flow style like {server: {host: localhost, ports: [80, 443]}} so it fits in a single environment variable, a --set-string Helm argument or a JSON field.
The full YAML 1.2 grammar is supported: block and flow collections, anchors (&name), aliases (*name), merge keys (<<:), explicit and application-specific tags, literal (|) and folded (>) block scalars with their chomping indicators, multi-document streams, directives, complex keys and non-ASCII content.
Finding the real syntax error
Validate mode reports every problem with its exact line and column, a caret pointing at the offending character, and a plain-English explanation of the rule that was broken - tab character used for indentation, duplicate key, all mapping items must start at the same column - instead of a generic “invalid YAML”. Tabs come with a one-click conversion to spaces, and duplicate keys cite both line numbers, since a silently discarded duplicate is the single most common reason a config change appears to do nothing.
yes, no, on, off, y and n resolve to booleans, so the country code NO becomes false and a GitHub Actions on: key is technically a boolean. YAML 1.2’s core schema keeps them as strings. Version-like values are just as sharp: unquoted 1.10 is a float, so it silently becomes 1.1. Every one of these is flagged with a quick fix that quotes it.Converting between YAML and JSON
Conversion runs in both directions with key order preserved. Going to JSON, aliases are resolved, <<: merge keys are applied, and a multi-document stream becomes a JSON array with one entry per document. Integers larger than JavaScript can hold are kept exactly rather than being pushed through a float. Coming from JSON, the result is idiomatic block-style YAML at your chosen indent and quote style, and NaN, Infinity and malformed input are reported with the position of the problem.
Team style, anchors and multi-document streams
Indent width and whether block sequence dashes sit under their parent key are the two things teams argue about most, so both are configurable, along with quote style, null spelling, document markers and boolean normalisation. One-click presets cover Prettier defaults, Kubernetes, GitHub Actions, Ansible, docker-compose and OpenAPI. Key sorting is available alphabetically, in reverse, or recursively, but defaults to preserve order, because order is semantically meaningful in CI configs - and the tool warns you when the document looks like one.
Anchors and aliases are preserved by default and listed in a usage table showing where each is defined and referenced, or they can be expanded inline to reveal the fully resolved document. A ----separated stream, the normal shape of a kubectl apply -f bundle, is split into individually formatted documents, each labelled with its Kubernetes kind/name where one is detectable, with its own copy button. A key path explorer produces dotted paths such as spec.template.spec.containers[0].image for yq queries and Helm --set arguments.
Private by design
Most online YAML formatters POST your document to a remote endpoint, which is unacceptable when the file contains cluster names, internal hostnames, image registries, service topology or a secret nobody remembered to strip. Everything here happens in your own browser tab: no upload, no round-trip, no logging. Diff mode shows a line-by-line comparison so a reviewer can confirm a change is whitespace-only, and the error list exports as CSV for a code review or a ticket.