1001Ferramentas
🔀Dev

.env File Diff

Compare two .env files showing keys only in A, only in B, and differing.


  

Comparing two .env files key by key

Paste both files and the page shows what exists on only one side and what exists on both with different values. It is the check that heads off the most mundane deployment incident: the variable that exists in development, does not exist in production, and only surfaces when the code reads it and gets undefined.

The comparison normalises what needs normalising. The export prefix is accepted, because an environment file is often also sourced by a shell. Quotes around a value are stripped before comparing, since the loader strips them — without that, one side quoted and the other not would show as different while holding the same value. Comments and blank lines are ignored.

The output separates three situations because each calls for different action: a key only in the first file is usually a new variable that needs propagating; a key only in the second may be a leftover from something removed; and a differing value is the normal, expected case between environments — database address, API key, log level. The summary at the top gives the count of each.

Frequently asked questions

Does the tool expose my secrets?
No. Everything runs in your browser and nothing is sent to any server. Even so, the prudent habit with production values is to compare only the key names — which is where the useful information is — and leave the values out when you do not need them.
Why does an example file help?
Because it is the contract: it lists every key the application needs, with empty or placeholder values, and it stays in version control. Comparing the real environment against the example catches a new key the code has started requiring. That is the commonest use of this comparison.
Are multiline values handled?
No. The comparison is line by line, so a value spanning several lines — a certificate, a private key — shows up truncated at the first. An ordinary file diff serves better for that; here the aim is to check the list of keys and short values.

Related Tools