.env File Validator

Check a .env file before it breaks your app or leaks a secret. Paste it or drop the file and get every syntax error, duplicate key and quoting problem with its line number, plus a warning for values that look like real credentials — API keys, tokens, passwords, database URLs. A .env.example with the values stripped is generated for you to commit instead. It's free, runs in your browser, and your secrets never leave your device.

Common .env mistakes

LineProblem
KEY = valueSpaces around = — some loaders keep them
MSG=hello worldUnquoted spaces — quote the value
PASS=abc#123# after a space starts a comment
2FA_KEY=xKeys can't start with a digit
KEY="unterminatedMissing closing quote

When to use it

  1. Find why an environment variable isn't being picked up.
  2. Check for duplicate keys after merging two .env files.
  3. Make sure no live API key ends up committed to git.
  4. Generate a .env.example for a project README.

How to Use

  1. Paste your .env or drop the file.
  2. Fix the errors and review the warnings by line number.
  3. Copy the generated .env.example to commit instead.

Features

  1. Syntax and quoting checks
  2. Duplicate key detection
  3. Secret and credential detection
  4. Multi-line values
  5. Generated .env.example
  6. 100% client-side

FAQs

Why is my .env value cut off?

Usually an unquoted value with spaces or a # in it. Wrap the value in double quotes.

What happens with duplicate keys?

Most loaders silently use the last one. The validator shows both lines so you can pick.

Should I commit my .env file?

No. Add .env to .gitignore and commit .env.example with the values removed.

How does it spot secrets?

By known key formats (AWS, Stripe, GitHub, Slack, JWTs, private keys) and by key names like SECRET, TOKEN or PASSWORD with real-looking values.

Is my .env uploaded?

No. It's checked entirely in your browser.

Technical Details

The validator follows the dotenv conventions most loaders share. Comments and blank lines are skipped, a leading export is allowed, and each remaining line must be KEY=value with a key of letters, digits and underscores that doesn't start with a digit; keys with dots or hyphens are flagged because shells can't export them. Values may be unquoted, or wrapped in single, double or backtick quotes; double-quoted values can span lines, unterminated quotes and text after a closing quote are errors, and an unquoted value containing spaces is a warning because shells and some loaders cut it short. Inline comments after an unquoted value are stripped as dotenv does. Duplicate keys are reported with the line of the first definition, since the later one usually wins silently. Values are checked for well-known credential formats — AWS access keys, Stripe live keys, GitHub, Slack, Google and AI-provider tokens, private keys, JWTs and URLs with embedded passwords — and keys named like secrets with non-placeholder values are flagged, as are long high-entropy strings. A .env.example is produced with every value removed and comments kept.

Developer Tools

Developer Tools

  • HTTP Headers Parser
  • Cookie Parser
  • Dockerfile Generator
  • Nginx Config Generator
  • README Generator
  • Dockerfile Linter
  • SSH Config Generator
  • .dockerignore Generator