Compare two .env files and show added, removed, and changed variables. Part of the DevTools Surf developer suite. Browse more tools in the Text / String collection.
Use Cases
Catch missing environment variables before deployment
Compare staging and production environment configs
Audit environment variable changes during code review
Onboard new developers by showing required local env vars
Tips
Paste two .env files to see added, removed, and changed vars
Spot missing environment variables before deploying to staging
Compare local and production .env files side by side
Fun Facts
The .env file convention was popularized by the twelve-factor app methodology published by Heroku engineers in 2011.
The dotenv library for Node.js has over 35 million weekly downloads on npm, making it one of the most depended-upon packages.
Environment variables in Unix date back to Version 7 Unix (1979), introduced as part of the Bourne shell by Stephen Bourne.
FAQ
What counts as a change?
Added keys, removed keys, and changed values. Comments and blank lines are ignored — only meaningful env-variable differences are reported.
Does it sort keys before comparing?
.env files often have logical grouping, so the tool preserves order by default. Toggle 'sort first' if you want an order-independent diff.
Can it handle multi-line values?
Yes — values wrapped in quotes that span multiple lines (common for RSA keys or JSON secrets) are treated as a single value.