Env File Validator

Validate .env file format and compare against .env.example to find missing, extra, and duplicate keys. Color-coded results highlight issues instantly.

.env File

.env.example File

Paste your .env file content and click Validate to check for issues

Env File Validator

Validate .env file format and compare against .env.example to find missing, extra, and duplicate keys. Color-coded results highlight issues instantly.

Features

  • Parse `.env` files and flag duplicate keys, missing values, unquoted spaces
  • Compare against a `.env.example` template to find missing or extra keys
  • Comments (lines starting with `#`) are handled
  • Multi-line values and escape sequences (\n, line-continuation) are NOT supported — single-line KEY=value only
  • Runs entirely in your browser; pasted env values never leave your machine

How to use

  1. Paste your .env file content in the left panel.
  2. Optionally paste your .env.example file in the right panel to compare keys.
  3. Click Validate to see format warnings and key comparison results.

Tips & Best Practices

  • Single-line `KEY=value` is the supported shape. Multi-line values or escaped newlines parse incorrectly — use \n in your code if you need actual newlines.
  • Quotes (single or double) around values are preserved as data — the validator doesn't strip them or re-interpret escapes.
  • Compare mode helps catch the classic "I added a new env var locally but forgot to update .env.example" issue.
  • For production env validation, use your framework's schema validator (e.g. zod, valibot) at startup.
  • Comment patterns: full-line `# comment`, trailing `KEY=value # comment` is NOT split — the comment becomes part of the value.

FAQ

What format issues does it detect?

The validator checks for missing equals signs, invalid key names (keys must start with a letter or underscore), unquoted values containing spaces, empty values, and duplicate keys. Each issue includes the line number and a clear description.

How does the key comparison work?

When you provide both .env and .env.example content, the tool compares their keys. Missing keys are in .env.example but not in your .env, extra keys are in your .env but not in .env.example, and matching keys appear in both files.

Is the .env.example panel required?

No. You can validate just the .env file format without providing an .env.example. The comparison section will only appear when both files are provided.

Does it check the values of environment variables?

The tool validates the format of values (quoting, empty values) but does not evaluate or validate the actual content of values. It focuses on structural correctness and key consistency.

Is my .env data secure?

Absolutely. All validation happens entirely in your browser. No data is sent to any server. Your environment variables, secrets, and API keys never leave your device.

Can I use this for Docker .env files?

Yes. The KEY=VALUE format is the same for Docker .env files, docker-compose environment files, and standard dotenv files. The validator works for all of these formats.