Compare two environment configs
Paste two sets of environment variables — staging and production, say — and see which keys are missing on each side and which values differ, matched by key rather than line order.
Open the tool, then paste the sample input below. Everything runs locally in your browser.
The problem
Config drift between environments causes bugs that only appear in one place. Comparing two .env files by eye is unreliable because key order differs. Matching on the key shows exactly which variables are missing on each side and which values changed.
Sample input
DB_HOST=stg-db
LOG_LEVEL=debug
FEATURE_X=on
DB_HOST=prod-db
LOG_LEVEL=info
Expected output
DB_HOST changed stg-db -> prod-db
LOG_LEVEL changed debug -> info
FEATURE_X only in Staging
Matching on the key, FEATURE_X is missing from Production and two values differ — exactly the drift you want to catch before a deploy.
How to do it
- Paste the first environment's config.
- Paste the second environment's config.
- Compare them by key.
- Review changed values and keys missing on each side.
- Reconcile the drift before deploying.
Common mistakes
- Comparing by line order instead of by key.
- Leaving secrets in the configs you paste.
- Ignoring keys present in one environment but not the other.
- Treating a quoted and unquoted value as different.
- Missing case differences in keys.
Related tools
Related guides
FAQ
How do I compare two environment configs?
Paste both sets of variables and compare them by key. The result shows changed values and any key present in one environment but missing from the other.
Why compare by key instead of by line?
Environments list variables in different orders, so a line diff is noisy. Matching on the key name reports only real differences in values and presence.
What is config drift?
Drift is when environments that should match have diverged — a missing key or a different value. It causes bugs that appear in one environment but not another.
Should I paste secrets?
Avoid pasting real secrets. The comparison runs locally and nothing is uploaded, but mask sensitive values before sharing any output.
Is my config uploaded?
No. The comparison runs locally in your browser. Nothing is sent to a server.
Environment comparison runs locally in your browser. Nothing is uploaded.
Compare environments and files, clean data and build SQL filters — grouped in one place.
Practical example and expected result
Paste two sets of environment variables - staging and production, say - and see which keys are missing on each side and which values differ, matched by key rather than line order. In practice, this is most useful when you need a quick, repeatable check on a developer artifact before adding it to a ticket, pull request, test fixture, or support note.
A realistic input for this workflow is DB_HOST=stg-db LOG_LEVEL=debug FEATURE_X=on. The expected result should resemble DB_HOST=prod-db LOG_LEVEL=info, with the same important values preserved.
Troubleshooting checklist
- Confirm you copied the complete developer artifact and not only a partial line or truncated preview.
- Run the local tool once with a safe sample, then repeat with the real data only if your team policy allows it.
- Check quoting, escaping, whitespace, encoding, timestamps, and environment-specific values before trusting the result.
- Before sharing output, remove secrets, tokens, cookies, customer data, and production hostnames that are not needed for the review.
Next useful steps
- Open this example in Compare Environments → for a related validation or follow-up step.
- Convert .env to JSON for a related validation or follow-up step.
- Diff as plain text for a related validation or follow-up step.
- Use Magic Box when you are not sure which tool should handle the next artifact.