.env File Editor – Keep Environment Variables Consistent
Sort, deduplicate, and diff .env files between environments
No signup • Runs in browser • Free
Application secrets drift quickly. Developers paste production .env files into staging, add temporary keys, and push
half-updated configs to CI. The DevToolBox .env File Editor acts as a guardrail: two panes for source and target envs,
diff summaries, duplicate detection, and copy-ready exports for commit hooks.
Problems solved
- Missing variables: The editor lists keys present in prod but absent in staging (and vice versa) so hotfixes no longer fail due to undefined secrets.
- Duplicate definitions: Sort and deduplicate to eliminate conflicting values introduced by merges.
- Secret safety: Mask values by default when screen sharing or recording video walkthroughs.
How to use the editor
- Paste the canonical
.envinto the Source panel (usually production). - Paste another environment (staging, QA, developer machine) into Target.
- Review the duplicate count and invalid-line indicators above each textarea.
- Toggle Mask values if you are sharing your screen to hide secrets.
- Use the Sort & deduplicate button per panel to normalize formatting. Casing and quoting are preserved.
- Copy the cleaned files back into your repository or deploy pipeline.
Integrate with CI
We recommend storing golden .env templates alongside application code. Add a step to npm run lint or a shell script:
node scripts/compare-env.js .env.example .env.development
...and let the script fail the build when keys drift. For ad-hoc checks, use the UI and commit the normalized output.
Related workflows
- Use the Docker Compose Validator to ensure services referencing
.envfiles have valid restart policies and resource limits. - Use the JSON Formatter to clean config maps before converting them into environment variables.
- When YAML manifests need the same variables, validate them with the YAML Validator Online.