Skip to content
Your text never leaves your browser

YAML Formatter

YAML, but readable. What a concept.

Input
Output

What this does

DEVS: js-yaml.load() → js-yaml.dump(). Client-side YAML 1.2 parser. No server.

Paste your YAML, hit Format, and 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.

YAML's biggest gotcha is that indentation is structural. One space off and a nested key becomes a sibling, or worse, the whole file breaks silently and your deployment config does something creative at 2 AM. This formatter normalizes all of that. It also catches the classic mistakes: tabs mixed with spaces (YAML forbids tabs), missing colons, and duplicate keys that most parsers quietly overwrite without telling you.

Then there's the Norway problem. In YAML 1.1, bare NO gets interpreted as boolean false. So does 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 (js-yaml), which fixes most of that behavior, but it's still worth quoting strings if there's any ambiguity. When in doubt, quotes.

The "To JSON" button converts your YAML to JSON in one click. This is useful more often than you'd think. Plenty of tools and APIs only accept JSON. If you're comparing a YAML config to a JSON payload, converting one to match the other saves time. It also helps when you're debugging: JSON's stricter syntax sometimes makes structural issues more obvious than YAML's whitespace-dependent format.

YAML supports multiline strings in several ways (literal blocks with |, folded blocks with >, plain flow scalars) and they all behave slightly differently with trailing newlines. The formatter preserves these, but if your multiline strings look wrong after formatting, the original probably had inconsistent block indicators. YAML gives you options. Sometimes too many options.

Everything runs client-side using js-yaml. Your Docker Compose files, Kubernetes manifests, CI configs, Ansible playbooks, and whatever secrets are hiding in your values files. None of it leaves your browser. Copy grabs the formatted output, Clear resets everything, and you can paste the next file without reloading.