Skip to content

.env file diff

Compare two .env files and list the variables that are missing or differ.

Input
File B (.env)
Output

.env file diff

Paste one .env file on the left and a second one on the right, and this tool tells you exactly how they differ: which variables exist only in file A, which exist only in file B, and which are present in both but hold a different value. It is built for the moment you are about to deploy and need to know what changed between .env.development and .env.production, or why a teammate's local setup behaves differently from yours.

Turn off "Compare values, not just names" to check presence only — useful when you only care that every required key exists, not what it is set to. "Treat empty values as missing" makes VAR= count the same as a missing VAR, which matches how most tools that read .env files actually behave. "Ignore variables matching" accepts comma-separated patterns with a wildcard, so PRIVATE_* or *_DEBUG can be excluded from the comparison entirely without editing either file. Turn on "Mask values in output" before pasting a screenshot or sharing a result — every value is replaced with a fixed-length placeholder, so secrets never appear in the report and their length isn't leaked either.

Beyond a plain difference report, "Result" can generate a merged .env file — every key from both files, with file B's value winning on conflict and a comment noting the original value from file A — or a value-free .env.example template listing every key found in either file, ready to hand to a new contributor. The diff report itself can render as a readable list or as an aligned table. Comments and line order in the input files never affect the comparison, since keys are matched by name, not by position.

Everything runs locally in your browser — the files you paste, including any secrets in them, are never uploaded anywhere. Copy the result, download it as a .txt file, or send it straight back into the input to keep iterating.

FAQ

How does it decide which file "wins" when a value differs?
In the difference report neither file wins — both values are shown side by side. When generating a merged file, file B's value is kept and a comment above it records what file A had.
Does the order of variables or the presence of comments matter?
No. Variables are matched by name, so reordering lines or adding comments in either file has no effect on the result.
What counts as a valid variable name?
A standard shell-style name: letters, digits and underscores, not starting with a digit. Lines that don't match that shape, along with blank lines and comments, are skipped.
What does the ignore pattern support?
Comma-separated patterns where * matches any run of characters, for example TEST_* or *_DEBUG. Any variable name matching one of the patterns is left out of the comparison and the generated output.
Are the .env files I paste ever uploaded?
No. Comparison happens entirely in your browser using JavaScript — nothing you paste, including secrets, ever leaves your device.