Compare .env Files Online
Paste two .env files. Spot missing variables, changed values, and configuration drift between environments.
🔒 100% private — runs entirely in your browseror try sample data
Paste two .env files. Spot missing variables, changed values, and configuration drift between environments.
🔒 100% private — runs entirely in your browseror try sample data
Env File Diff compares two .env files and shows you exactly which environment variables were added, removed, or changed. Whether you are deploying to a new environment, onboarding a teammate, or auditing configuration drift between dev, staging, and production, this tool gives you a clear, color-coded view of every difference.
Missing environment variables are one of the most common causes of deployment failures. An app that works perfectly in development crashes in production because SENTRY_DSN was never set, or DATABASE_SSL was left as false. Manually scanning two .env files line by line is tedious and unreliable, especially when files have different ordering or spacing. A visual diff catches every gap instantly.
Paste your .env files from any environment. The comparison runs entirely in your browser — your secrets, API keys, and database credentials are never sent to any server. The tool handles comments, blank lines, quoted values, and variable references, showing you the complete picture of how two environments differ.
# .env.development
NODE_ENV=development
DATABASE_URL=postgres://localhost:5432/myapp_dev
LOG_LEVEL=debug
DEBUG=true # .env.production
NODE_ENV=production
DATABASE_URL=postgres://db.internal:5432/myapp_prod
DATABASE_SSL=true
LOG_LEVEL=error
SENTRY_DSN=https://key@sentry.io/123 # Diff reveals:
# - DEBUG removed in production
# - DATABASE_SSL added for production
# - SENTRY_DSN only in production
# - LOG_LEVEL changed from debug to errorProduction environments typically add monitoring (Sentry), enable SSL, and remove debug flags. The diff catches all of these in one view.
# .env.example (template from repo)
DATABASE_URL=
REDIS_URL=
JWT_SECRET=
SMTP_HOST=
STRIPE_KEY= # .env.staging (partially configured)
DATABASE_URL=postgres://staging-db:5432/app
REDIS_URL=redis://staging-cache:6379
JWT_SECRET=staging-jwt-secret # Diff shows SMTP_HOST and STRIPE_KEY are
# missing from staging — they need to be set
# before deployment.Compare your .env.example template against each environment's actual .env file to find variables that still need to be configured.
# Before rotation
JWT_SECRET=old-secret-key-abc123
SESSION_SECRET=old-session-xyz789
STRIPE_WEBHOOK_SECRET=whsec_old_secret # After rotation
JWT_SECRET=new-secret-key-def456
SESSION_SECRET=new-session-uvw012
STRIPE_WEBHOOK_SECRET=whsec_new_secret # Diff confirms all three secrets were
# updated. Any unchanged secret may indicate
# a missed rotation.After a secret rotation, compare the old and new .env files to verify every secret was updated. Missed rotations are a security risk.
.env files have no required ordering. The same variables might appear in a different sequence across environments, causing the diff to show many lines as changed even when values are identical. Group variables by section (Database, Auth, Email) in all environments to keep diffs clean and readable.
APP_URL=https://example.com and APP_URL="https://example.com" are functionally identical in most dotenv parsers, but the diff tool shows them as different because it compares raw text. Standardize quoting conventions across environments to reduce diff noise.
While this tool is safe (everything runs client-side), be cautious about where you store .env files. Never commit actual secrets to Git. Use .env.example with placeholder values as a template, and manage real secrets through a vault or secrets manager. The diff tool is ideal for comparing templates, not for sharing production secrets.
Paste your .env files into the two panels and click Compare. The tool highlights added, removed, and modified variables with line-by-line comparison and word-level highlighting. Missing variables are immediately visible as red (removed) or green (added) lines.
Yes. Variables present in one file but absent in the other are highlighted as additions or removals. This is the primary use case — catching missing configuration before it causes a deployment failure.
Yes. This tool runs entirely in your browser using client-side JavaScript. Your environment variables, API keys, database credentials, and secrets are never sent to any server. However, avoid sharing your screen or taking screenshots while comparing sensitive files.
Yes. Comparing environment-specific .env files is the primary use case. The diff shows which variables differ between environments (changed values), which are missing entirely (added/removed), and which are identical (unchanged).
Yes. Lines starting with # are treated as regular text lines and included in the comparison. This helps you track documentation and section header changes alongside variable changes.
Variable references like ${DB_PASSWORD} or $SECRET_FROM_VAULT are compared as literal text. The tool does not resolve or expand variable references — it shows you exactly what is written in each file.