YAML Formatter & Validator
YAML, but readable. What a concept.
What this does
Paste your YAML, hit Format, get consistent indentation back. The tool parses the entire document and re-serializes it, which means it also catches structural problems. If it won't format, your YAML has issues. That's a feature, not a bug. The "To JSON" button converts your YAML to JSON in one click.
Common use cases
Normalizing config files. Docker Compose, Kubernetes manifests, CI pipelines, Ansible playbooks. One space off in YAML and a nested key becomes a sibling, or worse, the whole file breaks silently and your deployment does something creative at 2 AM.
Converting to JSON for tools or APIs that only accept it. Comparing a YAML config to a JSON payload is easier when they're in the same format.
Catching errors before they cause problems. Tabs mixed with spaces (YAML forbids tabs), missing colons, duplicate keys that most parsers quietly overwrite without telling you.
Things to know
Your comments stay. Header notes, end-of-line remarks, that commented-out block nobody remembers writing. The formatter fixes the indentation around them and leaves the words alone. Anchors keep their names too, so &base and every *base pointing at it come back exactly as written, << merge keys included.
The Norway problem. In YAML 1.1, bare NO gets interpreted as boolean false. So do off, n, and about a dozen other strings you'd never expect. Country codes, feature flags, survey answers. All quietly becoming booleans. This tool uses a YAML 1.2 parser (the yaml library), which fixes most of that. Formatting leaves NO exactly as you wrote it, and To JSON turns it into the string "NO". Whatever reads the file next might still speak YAML 1.1, though. When in doubt, quote your strings.
Multiline strings keep their style. Literal | blocks stay literal, folded > blocks stay folded, and quotes stay the quotes you picked. One catch: the formatter joins the lines inside a folded block into one long line. YAML reads it as the same string, but the line breaks you typed are gone. Runs of blank lines also shrink to one.
Privacy
Everything runs client-side using the yaml library. Your Docker Compose files, Kubernetes manifests, and whatever secrets are hiding in your values files never leave your browser.