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

When you clone a repository, your .env is often missing keys that exist in .env.example, either because the team added a new setting or because your copy is older. The app then fails at runtime with errors like PORT is not defined instead of telling you which key is missing.

This diff tool compares the two files and shows exactly what is missing, what is extra and what matches, so you restore the contract in seconds instead of guessing. Pair it with the validate tool so both files are checked for errors at the same time.

  • Missing keys: present in .env.example but absent from your .env
  • Extra keys: present in your .env but not in the example file
  • Matched keys: defined in both files and ready to use

How to sync .env with .env.example

Follow these steps to bring any .env back in sync with its example file in under a minute.

  1. Paste your current .env into the left editor
  2. Paste the .env.example file into the right editor
  3. Read the missing and extra keys highlighted in the report
  4. Add the missing keys with the values your team expects
  5. Run envy diff in the terminal to confirm the files match

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.