Skip to content
FreeNo sign-up

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

  1. Paste one file into each box. Order matters only for the labels.
  2. 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.
  3. 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.
  4. 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.

Names that exist in only one file (two columns: first file, second file)
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 environments
Example. Kiteline is a fictional company.

Questions 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.

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.