DevOps & Config

dotenv Diff & Validator

Compare two `.env` files, find missing keys, and check for committed secrets.

  • Nothing savedInput and output stay in memory and are gone when you leave this page.
  • Runs in your browserProcessing happens in this page. No application server receives your input.

Left (.env.example)

Nothing on this page is saved. Closing or reloading the tab discards it permanently.

Right (.env)

Nothing on this page is saved. Closing or reloading the tab discards it permanently.

Summary

Targets
POSIX / Docker Compose / dotenv-expand .env syntax
Keys left
โ€”
Keys right
โ€”
Only left
โ€”
Only right
โ€”
Different
โ€”
Identical
โ€”

Key-set comparison

KeyLeftRightStatusVisibility
No keys to compare.

Validation and secret findings

SeverityRuleLineFinding
Enter .env text to see its findings.

Redacted .env output (right side)

Removed credentials

KeyLineReasonBytes
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

LineRead as
KEY=valueAn assignment. Whitespace around = is stripped; internal unquoted whitespace is kept, trailing whitespace is stripped.
export KEY=valueSame 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

RuleSeverityFires when
ENV/duplicate-keyerrorA key is assigned twice. Silent last-wins is how a staging URL ends up in production
ENV/unresolved-referencewarning${NAME} names a key not present in this file
ENV/looks-like-secretwarningclassifySecret matched. Names the rule that matched
ENV/missing-from-templatewarningThe non-template side lacks a key the template has
ENV/whitespace-valueinfoAn 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.