dotenv Diff & Validator
Compare two `.env` files, find missing keys, and check for committed secrets.
- Input and output stay in memory and are gone when you leave this page.
Nothing saved
Input and output stay in memory and are gone when you leave this page. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
Left (.env.example)
Right (.env)
Summary
- Targets
- POSIX / Docker Compose / dotenv-expand .env syntax
- Keys left
- โ
- Keys right
- โ
- Only left
- โ
- Only right
- โ
- Different
- โ
- Identical
- โ
Key-set comparison
| Key | Left | Right | Status | Visibility |
|---|---|---|---|---|
| No keys to compare. | ||||
Validation and secret findings
| Severity | Rule | Line | Finding |
|---|---|---|---|
| Enter .env text to see its findings. | |||
Redacted .env output (right side)
Removed credentials
| Key | Line | Reason | Bytes |
|---|---|---|---|
| Enter .env text on the right side to see which credentials are removed. | |||
Environment File Comparison and Secret Redaction Reference
Compares two .env files as key sets rather than line-by-line text so reordering keys does not create false diffs. Duplicate keys follow last-wins semantics while reporting an explicit error diagnostic.
Accepted dotenv Grammar
| Line | Read as |
|---|---|
KEY=value | An assignment. Whitespace around = is stripped; internal unquoted whitespace is kept, trailing whitespace is stripped. |
export KEY=value | Same as KEY=value; leading export is stripped. |
KEY="value" | Double-quoted; \n, \t, \r, \\, and \" are unescaped and values may span lines. |
KEY='value' | Single-quoted literal; nothing is unescaped. |
KEY= | Assignment of the empty string (distinct from an absent key). |
Limits and Scope
It compares keys and values as written. It does not evaluate: ${OTHER} interpolation is reported as an unresolved reference and never substituted, and $(command) is reported and never run (TH-15). It does not know which keys your application requires: the template checkbox lets you nominate one side as the expected key set, and that is as far as a static tool can go. Secret detection is pattern and entropy matching over a fixed rule list, which means it has both false positives (a long random-looking build hash) and false negatives (a four-character password); it is a prompt, not a gate, and a clean result is never evidence that a file is safe to commit. Values are masked in the table but they are in the page: this tool reduces the chance of a screenshot leaking a secret, it does not eliminate it.
Diagnostic Rules
| Rule | Severity | Fires when |
|---|---|---|
ENV/duplicate-key | error | A key is assigned twice. Silent last-wins is how a staging URL ends up in production |
ENV/unresolved-reference | warning | ${NAME} names a key not present in this file |
ENV/looks-like-secret | warning | classifySecret matched. Names the rule that matched |
ENV/missing-from-template | warning | The non-template side lacks a key the template has |
ENV/whitespace-value | info | An unquoted value with leading or trailing whitespace, which some loaders keep and some strip |
Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.