All Tools View Categories About Contact Privacy

.env Merge Tool

Merge two .env files with a configurable conflict strategy and a full change summary.

Runs entirely in your browser — nothing is uploaded.

About .env Merge Tool

Environments rarely start from one file. There is a base configuration, an environment-specific overlay, a teammate's local tweaks, and suddenly merging them means resolving conflicts by hand — copying a value here, dropping a key there, hoping the ordering is right and the result is complete.

The .env Merge Tool turns that chore into a deterministic operation. Paste file A and file B, pick a conflict strategy, and receive the merged result plus a clear summary: how many keys were added, changed, kept, and how many conflicts were resolved which way. Quoted values are unwrapped consistently, duplicates inside a file resolve to the last value (dotenv semantics), and comments are dropped so the output is a clean, source-of-truth file.

Because the merge is a pure function of its inputs and the strategy, the same two files always produce the same output — easy to review, easy to test, and completely private.

Features

  • Two-file merge: file A (base) + file B (overlay).
  • Conflict strategies: B wins, Keep A, Keep B-only, Keep both (renamed).
  • Change summary: added, changed, kept and conflict counts.
  • Deterministic: same inputs and strategy always merge the same.
  • Dotenv semantics: last duplicate wins; quoted values unwrapped.
  • Clean output: comments and blanks removed from the result.
  • Copy or download: clipboard or a .env file in one click.
  • Private: all conversion happens in your browser.

How to Use

  1. Paste file A (the base) into the first box, or load the sample.
  2. Paste file B (the overlay) into the second box.
  3. Choose a conflict strategy from the dropdown.
  4. Click Merge. The combined file and its summary appear on the right.
  5. Review the summary to confirm the merge behaved as intended, then copy or download.

Examples

Example 1 — Default plus staging overlay. A team keeps a shared .env with defaults and a staging-specific .env; with B wins, the staging file overrides only the keys that differ.

Example 2 — Local overrides. A developer merges the repo .env with their personal local.env using B wins, producing a working environment without touching the shared file.

Example 3 — Staging vs production reconciliation. An engineer merges staging and production files with Keep A and inspects the summary to see exactly which values differ.

Example 4 — Keeping both. A cautious user merges with Keep both and reviews the KEY_A and KEY_B pairs before deciding which to promote.

Example 5 — Onboarding base. New hires merge the current prod overlay onto the base file to bootstrap their local setup consistently.

Benefits

  • No hand-merging: deterministic strategy-based output.
  • Conflict clarity: the summary shows every change.
  • Dotenv-correct: last duplicate wins, quotes unwrapped.
  • Flexible: four strategies for any workflow.
  • Reviewable: clean, comment-free result file.
  • Private & free: browser-only, no account.

Frequently Asked Questions

What does this tool do?
It merges two .env files into one. File A acts as the base and File B as the overlay. You choose how conflicts are resolved: B wins, keep only A, keep only B, or keep both with a rename. A summary reports how many keys were added, changed and kept.
When would I merge .env files?
When environments diverge — a team keeps a default .env plus an environment-specific overlay, a staging and production pair need to be reconciled, or a developer has local overrides on top of a shared base.
How are conflicts resolved?
The conflict strategy dropdown decides. B wins takes the value from file B for shared keys; Keep A ignores file B values for those keys; Keep B-only drops shared keys from A; Keep both writes both with a suffix (for example KEY_A and KEY_B).
How is the summary produced?
The tool compares key sets and values and reports counts: added (only in B), removed (only in A), changed (same key, different value) and unchanged. The merged file is deterministic and reviewable.
Does it handle comments and duplicates?
Comment lines and blanks are dropped from the merged output, quoted values are unwrapped, and duplicate keys inside a single file are resolved by keeping the last occurrence — the usual dotenv behavior.
Is my data uploaded?
No. Everything runs client-side in your browser. Nothing is sent to any server, stored or logged.