Skip to content
ZeroServer.tools

YAML Sorter

Recursively sort YAML mapping keys alphabetically at every nesting level.

Indent
Key sort
11 keys sorted
Sorted Output

How YAML key sorting works

This tool parses your YAML document, then walks the resulting structure recursively and sorts the keys of every mapping (object) alphabetically — at the top level and inside every nested mapping, no matter how deep. Sequences (lists) keep their original element order since order is usually meaningful there, but if a list item is itself a mapping, that item's keys get sorted too. The result is re-serialized as clean, consistently indented YAML. This is useful for normalizing config files (like Docker Compose or CI pipelines) so diffs only show real changes instead of key reordering noise. Everything runs locally in your browser — nothing is uploaded. For general formatting without reordering, try the YAML Formatter.

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Formatters & Validators tools