.env Validator & Diff.
Validate .env files and compare them with .env.example to find missing, extra and changed variables.
Runs in your browserAbout .env Validator & Diff
The .env Validator checks dotenv files against the rules that Node's dotenv, Laravel's phpdotenv and Docker Compose agree on, and compares one file with another so you can see which variables are missing before a deploy fails. Paste your .env on the left and, optionally, .env.example or the production file on the right. The validator reports lines without "=", names that start with a digit or contain spaces, unterminated quotes, text after a closing quote, spaces around "=" (Docker's --env-file treats them as part of the name), unquoted values that contain spaces (phpdotenv refuses to load them), duplicate keys (loaders disagree on which one wins) and ${VAR} references to variables that are not defined in the file or are defined further down. Quoted values may span several lines, as is common for private keys, and the export prefix is understood. The diff lists keys that exist only in your .env, keys that are missing from it and keys whose values differ. A typical case: .env.example gained MAIL_MAILER and QUEUE_CONNECTION in a recent commit, nobody updated the server, and the application falls back to defaults in production. Values are masked by default, showing only their length, so you can share your screen without exposing secrets; switch on Show values when you need them. Because .env files usually contain passwords and API keys, this page is marked sensitive: the input is never stored in the address bar or history, and everything is processed in your browser with no network requests.
How to Use
- Paste your .env file, and optionally the file to compare with.
- Fix the errors and warnings listed under Issues.
- Use the Diff table to add missing keys before deploying.
Frequently Asked Questions
Are my secrets sent anywhere?
No. The files are parsed in your browser, the page makes no network requests, and because the tool is marked sensitive its input is not saved in the URL or browser history.
Why is "KEY = value" a warning?
dotenv and phpdotenv trim the spaces, but Docker's --env-file and shells do not, so the same file behaves differently depending on who loads it. KEY=value works everywhere.
Why are values hidden in the diff?
To avoid showing secrets on screen. The diff still shows whether a value is empty and how long it is; turn on Show values to see the actual text.
Which value counts when a key appears twice?
The diff uses the last one, like Node's dotenv parser. Laravel's immutable phpdotenv loader keeps the first one, which is why duplicates are reported as warnings.
Related Tools
Check a Dockerfile for unpinned images, apt-get pitfalls, shell-form CMD, root users and baked-in secrets.
Validate TOML 1.0 with exact line and column errors and tidy its layout while keeping every comment.
Pretty print, minify, and validate JSON.
Compare two texts and see the differences.
Generate a Laravel APP_KEY (base64:…) for AES-256-CBC or GCM, like php artisan key:generate, in your browser.
Convert between YAML and JSON formats.