How It Works Under the Hood
The parser scans `KEY=VALUE` lines (supporting `export ` prefixes, quoted values, inline comments, and multi-line whitespace stripping) into key-indexed maps in memory, diffs missing/added/changed keys between left and right snapshots, and masks sensitive keys using pattern-based redaction.
Step-by-Step Instructions
Choose between Compare Two .env Files, Scrub Secrets -> .env.example, or Sort & Format .env.
Paste your `.env` configurations into the editor; no network call or storage persistence occurs.
Inspect added (`+`), removed (`-`), and value-changed (`~`) environment variables row by row.
Copy or download the sanitized `.env.example` or sorted `.env.formatted` output.
Key Features & Performance
- Side-by-side `.env` diff highlights missing production keys before broken deployments
- One-click secret scrubber converts tokens, passwords, and DSNs into safe placeholder hints
- Optional alphabetical sorting with duplicate key deduplication (last definition wins)
- Supports `export KEY=VALUE`, single/double-quoted values, and comment preservation on format
- Zero telemetry: safe for Stripe keys, database passwords, and JWT secrets
Methodology, Formulas & Technical Standards
Keys are normalized after trimming optional `export ` prefixes; comparison classifies entries into `added`, `removed`, `changed`, and `equal`. Secret sanitization preserves non-secret toggles (booleans, URLs without credentials, ports) while blanking keys matching secret/key/token/password/dsn patterns.
Common Real-World Use Cases
- Catching missing Cloudflare Pages or Docker environment variables before deploying a release
- Generating a clean `.env.example` template prior to committing a new open-source repository
- Auditing drift between `.env.staging` and `.env.production` snapshots locally
- Alphabetizing sprawling microservice `.env` manifests for easier code reviews
Worked Examples & Edge Cases
Secret Scrubbing to .env.example
STRIPE_SECRET_KEY=sk_live_abc123 PORT=3000
STRIPE_SECRET_KEY=YOUR_STRIPE_SECRET_KEY PORT=3000
Secret credentials are replaced while non-secret operational defaults stay readable.
Environment Drift Detection
Left: CACHE_TTL=3600 | Right: CACHE_TTL=86400 + SENTRY_DSN=...
~1 changed (CACHE_TTL), +1 added (SENTRY_DSN)
Immediately reveals missing observability variables across environments.
Limitations, Scope & Accuracy Notes
- • Variable interpolation syntax (`${HOST}`) is compared verbatim rather than expanded at runtime.
- • Always verify generated `.env.example` files before pushing if non-standard secret variable names hold credentials.
Local Browser Processing & Privacy
Traditional web converters upload your documents, snippets, or media files to remote servers. .env Diff, Formatter & Secret Sanitizer runs inside your browser tab:
Your input text and files are processed locally without uploading payloads to a processing server.
Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).
Working outputs stay in your browser tab and are released when you reset the tool or close the tab.
Frequently Asked Questions
Is it safe to paste real production `.env` secrets here?
Yes — parsing, diffing, and secret redaction happen strictly inside your browser tab RAM with zero outbound API requests.
What happens when a `.env` file defines the same key twice?
Following standard dotenv override precedence, the parser keeps the latest non-empty assignment for diffing and formatting.
Does the sanitizer preserve `export` prefixes or quoted comments?
Yes. `export ` prefixes are normalized to standard `KEY=VALUE` lines cleanly while stripping unescaped inline noise.
Can I download `.env.example` directly?
Yes. Switch to Scrub Secrets -> .env.example and click Save to download `.env.example` immediately.
Explore Related Micro-Tools
Text Diff Checker & Patch Generator
Compare two text blocks line-by-line or word-by-word and export unified .patch files
Docker Run ↔ Compose YAML Converter
Convert docker run CLI flags into compose.yaml services and translate Compose services back into docker run commands
Stack .gitignore Builder & Deduplicator
Compose clean deduplicated .gitignore templates across Node, Astro, Python, Rust, Go, macOS, VS Code & Docker