ENV Cleaner — remove noise from .env files
Strip duplicates, empty lines, comments, and trailing whitespace from any .env file. The cleaner keeps the last definition when duplicates exist — matching how dotenv behaves at runtime.
Clean your .env file. Remove duplicates, empty values, comments, and trailing whitespace in one click.
API_KEY=def DEBUG=true PORT=3000
Runs 100% in your browser. Your .env never touches our servers.
API_KEY=abc DEBUG=true API_KEY=def
DEBUG=true API_KEY=def
NODE_ENV=production EMPTY= PORT=3000
NODE_ENV=production PORT=3000
# app config DATABASE_URL=postgres://... # debugging flag DEBUG=true
DATABASE_URL=postgres://... DEBUG=true
Strip duplicates, empty lines, comments, and trailing whitespace from any .env file. The cleaner keeps the last definition when duplicates exist — matching how dotenv behaves at runtime.
The last definition wins — matching how dotenv behaves at runtime in Node.js, Python, and Ruby. If you have API_KEY=abc on line 2 and API_KEY=def on line 8, the output keeps API_KEY=def.
No. Values are never changed — only structural noise (duplicates, empty lines, comments, trailing whitespace) is removed. The cleaner is safe to run on a production .env.
Only if you enable the 'strip comments' option. By default, comments are preserved — they often document why a key exists or what values are valid.
Yes. Lines starting with export are recognised and preserved. The key is extracted correctly for duplicate detection.
We're building a tiny tool to keep .env files in sync across teammates and environments. Leave your email — no spam, just a single launch ping.