.env File Validator & .env.example Generator
NOUVEAU.env file validator that finds duplicate keys, invalid names, quote errors and likely secrets, then outputs a cleaned .env and a .env.example. Private.
Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.
Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.
Checked in your browser only. Nothing is uploaded or stored.
- Line 2 · warning · APP_NAME: Unquoted value contains spaces: shells split it. Wrap it in quotes.
- Line 4 · info · NODE_ENV: "export" prefix: fine for dotenv and shells, but docker --env-file reads it as part of the key.
- Line 5 · warning · PORT: Spaces around "=" work in dotenv but break when the file is sourced by a shell.
- Line 9 · warning · DB_POOL: Empty value.
- Line 14 · warning · COLOR: Unquoted value contains "#": some parsers cut the value there. Wrap it in quotes.
- Line 15 · warning · PORT: Duplicate key PORT on lines 5, 15. Line 15 wins.
- Line 16 · error · BROKEN: Unbalanced " quote: the value is never closed.
- Line 17 · error · 2FA_ENABLED: Invalid key "2FA_ENABLED": use letters, digits and underscores, not starting with a digit.
| Line | Key | Value | Flags |
|---|---|---|---|
| 2 | APP_NAME | My App | |
| 3 | APP_URL | http://localhost:3000 | |
| 4 | NODE_ENV | development | export |
| 5 | PORT | 3000 | overridden |
| 8 | DATABASE_URL | po••••••••••••pp | secret |
| 9 | DB_POOL | (empty) | |
| 12 | STRIPE_SECRET_KEY | sk••••••••••••le | secret |
| 13 | GREETING | Hello, world | "quoted" |
| 14 | COLOR | #ff0000 | |
| 15 | PORT | 4000 |
Cleaned .env (deduplicated, last value wins).env
APP_NAME='My App' APP_URL=http://localhost:3000 COLOR='#ff0000' DATABASE_URL=po••••••••••••pp DB_POOL= GREETING='Hello, world' NODE_ENV=development PORT=4000 STRIPE_SECRET_KEY=sk••••••••••••le
.env.example (values stripped).env.example
# Copy to .env and fill in the values APP_NAME= APP_URL= COLOR= DATABASE_URL= DB_POOL= GREETING= NODE_ENV= PORT= STRIPE_SECRET_KEY=
Exemples rapides
Des entrées typiques et les résultats produits par cet outil.
Présentation
A .env file holds configuration as KEY=value lines, read by dotenv, Docker Compose, Vite, Next.js and many other tools. Small mistakes are easy to miss: the same key defined twice, a name starting with a digit, an unclosed quote that swallows the next lines, or an unquoted # that cuts a value short. This .env file validator parses the file with dotenv rules and lists every problem with its line number.
Likely secrets (keys such as PASSWORD or TOKEN, and value patterns like private keys or URLs with credentials) are masked on screen. You get a cleaned, deduplicated .env and a .env.example with the values stripped, ready to commit. Validation runs only in your browser; nothing is uploaded.
Pourquoi utiliser cet outil ?
- See which duplicate value actually wins
- Catch quote and # mistakes before deploy
- Secrets masked while you review
- Generate a safe .env.example in one click
- Never leaves your browser
Fonctionnalités
Duplicate detection
Lists every line that defines the same key and which one wins (the last).
Syntax checks
Invalid keys, missing =, unbalanced quotes, spaces around =, empty values and export prefixes.
Secret masking
Likely secrets are masked in the table and cleaned output until you choose to show them.
Cleaned .env
One line per key, quotes added only where needed, optional A–Z sort.
.env.example
Same keys with empty values for your repository and onboarding docs.
Local only
Parsing happens in the page; no network request carries your file.
Mode d'emploi
Paste your .env
Paste the file into the box, or press Sample to see the checks in action.
Review issues
Read errors, warnings and notes, each with its line number.
Check the table
Overridden lines are struck through; tick Show secret values to unmask.
Copy or download
Download the cleaned .env and the .env.example.