A tidy .env is one you can scan. The Env File Sorter orders keys alphabetically — ascending or descending — or groups them by prefix so DB_, API_, and PUBLIC_ variables sit together.
Comments that document a key travel with it, so reordering never orphans an explanation. The result is deterministic: run it twice and the file comes out identical.