.env File Validator

Check environment-variable files for malformed lines, invalid keys, duplicate keys, missing values and the formatting mistakes that break deployments — without uploading your secrets.

Paste the contents of a .env file (or upload the file itself) and the validator parses it the way the major loaders do — python-dotenv, Node's dotenv, docker-compose and a plain shell set -a; . .env — then flags every line where those loaders disagree or where a classic mistake hides: unquoted $ that a shell will expand away, inline comments that become part of a password, duplicate keys where the last one silently wins, Windows line endings, and more. You get a line-by-line report, an interpolation reference map, and a cleaned-up file you can copy or download.

🔒 100% private — nothing is uploaded or stored. Your .env file contains secrets, so this tool never sends it anywhere: parsing, checking and export all run entirely in your browser. Nothing is posted to our servers, written to disk, or logged — and the page keeps working if your internet connection drops.

Paste or upload your .env file

Validation runs live as you type. File uploads are read locally in your browser — the file never leaves the page.

Samples:
Paste a .env file to validate it.

The .env mistakes that actually bite

A .env file is read by at least two different kinds of software — a dotenv-style parser in your application, and often a shell that sources it during deployment. They disagree on quotes, escapes, comments and interpolation, and most mistakes fail at 3am, not in review. These are the ones that show up most often:

  • Unquoted $ and backticks. API_URL=https://api.example.com/v1/$TOKEN is fine to most dotenv parsers, but the moment a deploy script runs set -a; . .env, the shell expands $TOKEN — usually to an empty string — and your URL is now https://api.example.com/v1/. Double-quote any value containing $.
  • Inline comments in unquoted values. PASSWORD=abc123 # production — many dotenv parsers keep # production as part of the password, so login fails with a credential that looks correct. Quote the value or move the comment to its own line.
  • Duplicate keys. If DB_HOST appears twice, most loaders silently keep the last value. The first one is dead config that misleads everyone who reads the file top-down.
  • Windows line endings (CRLF). Editing on Windows and deploying on Linux adds a hidden \r to the end of every value. Some parsers strip it, some don't — a trailing carriage return in a JWT secret is invisible and fatal. Save as LF.
  • UTF-8 BOM. A few editors (some Windows ones, notably) prepend an invisible BOM character. Most loaders cope; a few fold it into your first key name, so SECRET_KEY quietly becomes \uFEFFSECRET_KEY.
  • Whitespace before =. DB_PORT = 5432 looks harmless, but a shell will try to run DB_PORT as a command and most dotenv parsers reject the line outright.
  • Empty values. SMTP_PASSWORD= is either an empty string or undefined, depending on the loader — and the error message you get months later will not mention which one it was.
  • Committing the file itself. The rule that keeps .env files safe: .env goes in .gitignore, and a .env.example with the same keys but dummy values is what gets committed. This validator is useful for checking the example file too — it's the schema your teammates copy from.

Luke Keam
Thank you for reading. Get in touch
Luke Keam | techgeek.biz