Sort .env files alphabetically by key, keep comments grouped and drop empty lines. Env File Sorter is a free online tool from the ToolsRift Code Formatters collection. It runs entirely in your browser — nothing to install, no signup, and your data never leaves your device.
Every KEY=VALUE line is sorted alphabetically by the key name using a case-aware comparison, making variables easy to find and diffs smaller.
Comment lines starting with # are collected and placed at the top of the output so notes and section headers aren't lost.
No. Only the order of lines changes. Each key and its exact value are preserved; empty lines are simply removed.