All Tools View Categories About Contact Privacy

.env Diff Tool

Compare two .env files side by side and see added, removed, and changed keys with values.

Runs entirely in your browser — nothing is uploaded.

About .env Diff Tool

Most environment drift is invisible until a deploy breaks. Two .env files that look nearly identical can hide a changed database URL, a removed feature flag, or an added secret prefix — and eyeballing a couple of hundred lines of KEY=value is exactly how those differences slip past.

The .env Diff Tool compares two files by key name and reports only what matters: keys added in file B, keys removed from file A, and keys whose value changed, with both the old and new value shown. Ordinary unchanged keys stay out of the way, and a redaction toggle replaces values with [REDACTED] so the report can be shared without exposing secrets.

Matching is by key, not line order, so the output is a true semantic diff — deterministic, readable, and entirely computed in your browser.

Features

  • Key-based comparison: matches by name, ignores order and comments.
  • Three categories: added, removed, and changed with old/new values.
  • Unchanged grouping: identical keys are summarized, not listed.
  • Redaction toggle: replace values with [REDACTED] for safe sharing.
  • Clear output: markers (+ added / - removed / ~ changed) on every line.
  • Corner-case safe: quoted values unwrapped, duplicates last-wins.
  • Copy or download: clipboard or a .diff file in one click.
  • Private: all conversion happens in your browser.

How to Use

  1. Paste file A (the reference) into the first box, or load the sample.
  2. Paste file B (the comparison) into the second box.
  3. Optionally enable redaction to mask value contents.
  4. Click Compare. The diff report and summary appear on the right.
  5. Review the categories — added, removed, changed — and share or save the report.

Examples

Example 1 — Staging vs production. An engineer diffs staging.env and production.env and instantly sees the three keys that differ in DATABASE_URL and feature flags.

Example 2 — Deploy review. A reviewer checks the diff between a PR's .env changes and main to confirm no secret was altered silently; the redaction toggle keeps the report shareable.

Example 3 — Local drift. A developer compares their local.env with the base to spot a DEBUG flag they forgot to turn off.

Example 4 — Compliance audit. An auditor compares environments quarterly; the report shows added and removed keys, proving nothing sensitive changed outside the approved set.

Example 5 — Onboarding comparison. A new hire diffs their generated local .env against the team sample and corrects the differences in minutes.

Benefits

  • Semantic diff: matches by key, not by line.
  • Only the changes: unchanged keys stay out of the way.
  • Safe to share: redaction hides value contents.
  • Readable report: clear + - ~ markers and a summary.
  • Deterministic: same files always produce the same diff.
  • Private & free: browser-only, no account.

Frequently Asked Questions

What does this tool do?
It compares two .env files key by key and reports what changed: keys only in file B (added), keys only in file A (removed), and keys present in both with different values (changed), showing the old and new value side by side.
When is comparing .env files useful?
Auditing staging vs production, checking a teammate's local overrides against the base, reviewing a deploy that changed variables, or confirming two environments stayed in sync.
How does it mask secrets in the report?
A toggle replaces value contents with [REDACTED] in the diff report while still marking which keys changed. That way you can share a diff without leaking credential values.
Are identical keys ignored?
Yes. Keys present in both files with the same value are reported as unchanged and do not clutter the output. The summary line shows how many matched.
Does order matter?
No. Matching is by key name regardless of line order, which is the right comparison for environment files where order is meaningless.
Is my data uploaded?
No. Everything runs client-side in your browser. Nothing is sent to any server, stored or logged.