⚡
usefultools.dev
.env

.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.

9 variables2 errors5 warnings1 notes2 likely secrets
  • 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.
Parsed variables
LineKeyValueFlags
2APP_NAMEMy App
3APP_URLhttp://localhost:3000
4NODE_ENVdevelopmentexport
5PORT3000overridden
8DATABASE_URLpo••••••••••••ppsecret
9DB_POOL(empty)
12STRIPE_SECRET_KEYsk••••••••••••lesecret
13GREETINGHello, world"quoted"
14COLOR#ff0000
15PORT4000

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.

Duplicate
PORT=3000 then PORT=4000
Duplicate key PORT. Line 2 wins.
Error
2FA_ENABLED=true
Invalid key "2FA_ENABLED"
Warning
COLOR=#ff0000
Unquoted value contains "#"
Masked
API_KEY=abc123def456ghi
ab•••••••••••hi
.env.example
DB_PASS=secret
DB_PASS=
📖

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

1

Paste your .env

Paste the file into the box, or press Sample to see the checks in action.

2

Review issues

Read errors, warnings and notes, each with its line number.

3

Check the table

Overridden lines are struck through; tick Show secret values to unmask.

4

Copy or download

Download the cleaned .env and the .env.example.

🤔

Questions fréquentes