How to use the env file comparer
- Paste the first env file into box A and the second into box B. Lines look like KEY=value.
- Leave Show values for keys that differ unticked to keep secrets hidden. Only the length of each value is shown.
- Read the count of differences, then the tables of keys with different values, keys only in A and keys only in B.
- Download the CSV for a list of every key and its status.
Formula
parse each file into a map of keys to values
only in A = keys of A that are not in B; only in B = keys of B that are not in A
different = keys in both whose values are not equal
same = keys in both with equal values
Blank lines and lines that start with # are skipped, and a leading export is removed. Double or single quotes around a value are removed. For an unquoted value, a space followed by # starts a comment. If a key appears twice, the last value is used.
A live file against a test file
File A has DATABASE_URL, API_KEY, DEBUG, PORT and an empty SENTRY_DSN. File B has DATABASE_URL, API_KEY, DEBUG and CACHE_TTL. The page finds 5 differences: PORT and SENTRY_DSN exist only in A, CACHE_TTL exists only in B, and DATABASE_URL and DEBUG have different values.
API_KEY is the same in both. With values hidden, the table shows only lengths, such as 5 characters in one file against 9 in the other. A blank value shows as empty, which helps spot a key that exists but has not been filled in.
Keeping secrets out of sight
A comparison usually needs only the key names. By default the page hides the values, so you can share a screen or a screenshot without exposing them. Everything is computed in your browser and nothing is stored or uploaded. Even so, avoid pasting real production secrets into any web page, and compare copies with the secrets replaced when you can.
What it understands
The parser follows the common dotenv style. It does not expand variables such as ${OTHER}, run commands or handle multi-line values, so check those by eye. Lines that are not KEY=value are reported and skipped. For related tasks, see the Env File to JSON Converter, the Compare Two Lists tool and the Diff Checker.
Assumptions and limits
- Keys may contain letters, digits, underscores, dots and hyphens, and must not start with a digit.
- Values are compared exactly after quotes are removed. Whitespace around an unquoted value is trimmed.
- Each file is limited to 200,000 characters.
- Variable expansion and multi-line values are not handled.
Frequently asked questions
Does the page store or send my files?
No. Both boxes are compared in your browser, are not part of share links and are not saved. The values are hidden by default as an extra precaution.
What does a repeated key do?
The last value wins, like most dotenv loaders, and the page tells you which keys appeared more than once so you can fix the file.
Why did a line get skipped?
A line is skipped if it has no equals sign or if the key has characters other than letters, digits, underscore, dot and hyphen. The line numbers are listed.
Can I compare more than two files?
Not at once. Compare them in pairs, for example the live file against the test file and then the test file against your own copy.