Compare two .env files online

Paste .env.example and .env side by side. Missing, unused and matching keys update live as you type.

Free tool · Updated August 2026 · No account required

How It Works

1

Paste both files

The required file goes left, your candidate .env goes right. A sample is preloaded.

2

Read the three buckets

Missing, extra and matched keys with live counts in a single table.

3

Copy the fix

Every row has a copy button for a ready-to-paste KEY=value line.

Env diff

Live comparison, 100% in your browser

Required · .env.example
.env.example
9 lines · 171 chars runs locally in your browser
Candidate · .env
.env
5 lines · 98 chars runs locally in your browser

Missing

3

Extra

0

Matched

4

Keys compared

7

3 missing keys

Add them to the candidate before deploy, or copy each line below

StatusKeyValue
MissingREDIS_URLredis://localhost:6379
MissingSECRET_KEY
MissingSENTRY_DSN
MatchedPORT3000
MatchedHOST127.0.0.1
MatchedDATABASE_URLpostgres://dev:dev@localhost:5432/app
MatchedAPI_KEYlocal-dev-key

7 keys compared · Last validated just now

Runs locally in your browser

Why comparing .env files matters

Environment drift is a silent killer of deploys.

  • A teammate adds STRIPE_SECRET_KEY to .env.example
  • Your .env never gets it, and the payment code ships
  • Payments fail at runtime, not at build time

A missing-key diff catches this before CI does. It is the difference between a clean deploy and a hotfix at midnight.

How to keep .env.example and .env in sync

  1. Treat .env.example as the contract for every key your app reads.
  2. Compare your real .env against it in CI with envy diff.
  3. Pair it with the syntax validator so files are complete and valid before they ship.

Frequently Asked Questions

Common questions about comparing .env files

A key that exists in your required file (.env.example) but not in the candidate (.env). At runtime, code reading it gets undefined, which is how environment drift breaks production.