Compare two .env files
Paste two .env files to see which variables exist in only one of them and which have different values. Values stay hidden until you choose to show them, and the report you copy lists names only.
Runs in your browser. Nothing you type is sent anywhere.
The tool is code on this page. It makes no network requests while you use it, stores nothing in cookies or local storage, and keeps working if you go offline after the page loads.
Compare two .env files
Runs in your browser
For example .env.staging or .env.example
For example .env.production or your .env
Paste two files to compare them.
Example values use Kiteline, a fictional company.
How to use it
- Paste one file into each box. Order matters only for the labels.
- Start with the two "only in" groups: a variable missing from production, or from .env.example, can explain a deploy that works on one machine and not another.
- Check the different values. Press Show on one row to see both values, or show them all if no one is looking at your screen.
- Copy the report into a ticket or a pull request. It lists variable names by group, never values.
The same without a browser
A shell one-liner that compares names only, so no value appears on your screen.
comm -3 <(sed -nE 's/^(export +)?([A-Za-z_][A-Za-z0-9_]*)=.*/\2/p' .env.staging | sort -u) <(sed -nE 's/^(export +)?([A-Za-z_][A-Za-z0-9_]*)=.*/\2/p' .env.production | sort -u)How Crunu handles this
Compare environments without opening files
Crunu compares two environments the same way: which files and variables exist in only one of them and which differ, with values hidden until you press Show. You can copy selected values into the other environment, which saves a new signed version there. The comparison happens on your device, and the server never sees the values.
Read about comparing environmentsQuestions about this tool
Found a case the tool gets wrong? Write to support@crunu.com
Why are values hidden?
Because comparisons happen on shared screens and in screenshots. Nothing is sent anywhere either way; masking only keeps values off your display until you need them.
What if a variable appears twice in one file?
The last value is compared, as Node's dotenv, python-dotenv and Docker would use it, and the duplicate is listed under the result so you can clean it up.
Can I compare .env.example with my .env?
Yes, and that's a useful check: it shows variables that exist in your .env but were never added to the example, and the reverse. Different values are expected there, since the example should hold placeholders.
Do order, comments and quotes matter?
Order and comments don't. Quotes are removed the way a dotenv loader would remove them, so A='x' and A=x count as the same value.
Read more
Other free tools
- Secret key generatorRandom secrets in Base64, Base64URL, hex or letters and digits, from 128 to 512 bits, with a ready .env line.
- .env linterFinds lines that loaders read differently, values that run as commands when sourced, duplicates and values that look like real keys.
- .env converterTurns a .env file into JSON, YAML, a Docker --env-file or a systemd EnvironmentFile, and back again.
- OIDC trust policy builderTrust policies and credentials for GitHub Actions, GitLab CI and Bitbucket Pipelines on AWS, Google Cloud and Azure, with the CI snippet.
- Offboarding checklist generatorPick the services someone could reach and get an ordered checklist of what to close and which keys to reissue, with links.
When the values need a home
Crunu is a vault for your team's environment variables and keys. Values are encrypted on your devices, so the server stores them only as ciphertext. Free during early access.