.env File Formatter

Parse, sort, group, deduplicate, and validate .env files. Keep your environment variables organized and error-free.

Frequently Asked Questions

It parses your .env file content, sorts variables alphabetically, groups them by prefix (e.g. DB_, API_), removes duplicates, and validates each line for correct KEY=VALUE syntax.
When the same key appears multiple times, the formatter keeps the last occurrence (matching how most .env loaders behave) and reports the duplicates that were removed.
Lines that are not comments, not blank, and don't contain an = sign, or lines where the key contains spaces or starts with a number, are flagged as invalid.
The formatter looks for keys with a common prefix ending in underscore (e.g. DB_, API_, APP_). Variables sharing a prefix are grouped together with a blank line between groups.
No — the formatter only reorganizes and sorts lines. Key names and values are preserved exactly as entered.