.env Validator & Diff

Validate a .env file's syntax (catches missing equals signs, unquoted multi-word values, duplicate keys), or diff two .env files to spot drift between dev and prod environments.

How to use the .env Validator & Diff

Validate: paste your .env. The tool reports duplicate keys, lines missing =, unquoted values that contain spaces (often a bug), and keys with empty values. Diff: paste two .env files — typically your .env.example and your local .env — and see which keys are missing from each.

Validating and diffing .env files

The classic .env failure is not a syntax error — it is drift. A new key gets added to .env.example but not to someone’s local .env, or to dev but not prod, and the app crashes at runtime with a missing variable that nobody changed. Catching that means comparing two files key by key, not just checking that one is well-formed.

This does both: it validates a single .env for the usual problems (duplicate keys, lines missing =, unquoted multi-word values, empty values), and it diffs two files — typically .env.example against your local .env — to list the keys present in one but not the other. The diff is the part that catches environment drift; for a stricter single-file lint aimed at cross-loader portability, the .env validator (strict) goes deeper, and keep every .env out of version control with the .gitignore generator.

Common use cases

  • Catch drift — find keys in .env.example missing from a local or prod .env.
  • Onboarding — confirm a new clone has every variable the example lists.
  • Pre-deploy check — compare staging and production env files before shipping.
  • Quick lint — spot duplicate keys and missing = signs in one file.
  • Audit — verify two environments declare the same configuration surface.

Frequently asked questions

What is the difference from the dotenv validator?

This adds a two-file diff to catch drift; the .env validator (strict) is a stricter single-file linter for cross-loader portability.

Does the diff compare values or just keys?

Keys — it reports which keys exist in one file but not the other, the usual cause of runtime drift.

Is my data uploaded?

No — both validation and diff run entirely in your browser.

What counts as a validation error?

Duplicate keys, a line with no =, an unquoted value containing spaces, and empty values.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: