.env Formatter (Sort, Dedupe, Clean)
Paste your .env file, pick the clean-up options and copy the result. Duplicates and lines that are not valid are reported instead of disappearing silently.
Processed locally in your browser.
Not sure? Turn your internet off and try — it still works.
How it works
A .env file is a list of KEY=value lines read by tools such as dotenv, Docker and many frameworks. Over time it collects repeated keys, mixed quoting, stray spaces and comments in odd places. This formatter reads each line, keeps the comment that sits directly above a variable together with it, and writes the file back in a consistent shape. Double-quoted values understand escapes such as \n, single-quoted values are literal, and unquoted values end at a space followed by #. When the same key appears twice the last one is kept, which is what loaders such as dotenv end up with.