Skip to content
100% local

.env file validator

Check .env variable lists for bad keys, missing quotes and duplicates.

Input
Output

.env file validator

Paste the contents of a .env file and this tool checks every KEY=VALUE line for the mistakes that break a deploy without anyone noticing until runtime. It flags keys that contain anything other than uppercase letters, digits and underscores, values that contain spaces but were left unquoted, and keys that are defined more than once — each issue is reported as a readable comment with the exact line number, inserted right above the line it refers to, so you can scan a long file and fix problems in place.

Blank lines and lines starting with # are treated as comments and skipped during validation, matching how dotenv-style parsers actually read the file, so you won't get false positives on your own notes. A duplicate key is reported against the line where it was first defined, which matters when a later assignment silently overrides an earlier one — a common source of "why is this using the wrong value" bugs in local development and CI.

Turn on auto-fix to have the tool rewrite the file instead of just reporting on it: keys are capitalized, values containing spaces are wrapped in double quotes, and the whole list is sorted alphabetically by key so related settings are easy to find. Auto-fix cannot resolve a genuine duplicate or a line missing its "=" sign — those still show up as comments, because silently dropping a variable could change what your application does.

Everything runs locally in your browser. Environment files routinely hold API keys, database passwords and other secrets, so nothing you paste here is uploaded, logged or sent anywhere — the validation and any auto-fix happen entirely on your device, and the tab can be closed without a trace left behind.

FAQ

What counts as an invalid key?
Any key that contains characters other than uppercase A–Z, digits 0–9 or underscores — for example lowercase letters, hyphens or spaces.
Why does an unquoted value with a space get flagged?
Many .env parsers and shells split on the first space, so DESCRIPTION=hello world can silently become DESCRIPTION=hello with a stray "world". Wrapping the value in quotes avoids the ambiguity.
What does auto-fix actually change?
It uppercases every key, adds double quotes around values that contain spaces and aren't already quoted, and sorts the resulting KEY=VALUE lines alphabetically. Comments and blank lines are dropped in the process, since sorting would strand them next to the wrong entry.
Does it remove duplicate keys for me?
No. Removing a duplicate could delete the value your application actually relies on, so duplicates are only reported — with the line of the first definition — and left for you to resolve.
Is my .env file uploaded anywhere?
No. Validation and auto-fix both run entirely in your browser — the contents of your file, including any secrets, never leave your device.