Check a .env file and make a safe .env.example
Drop or paste a .env file to see mistakes, names set twice and secrets that would leak, then download a .env.example with the secret values taken out.
- Free, no sign-up
- Nothing uploaded
- .env.example, JSON, Compose
or drop it here · checked as you type
On a Mac the file window hides .env files: press Cmd+Shift+. to show them.
No .env handy? Try one:
How it works
- Drop or paste the .env file. It is read the way dotenv reads it:
NAME=value,export NAME=value, single, double and backtick quotes, values that run over several lines, and comments. Lines it cannot read get their line number and what to change. - Every name is checked. Names set twice, a
#that Node's dotenv treats as a comment, spaces that breaksource .envin a shell,${VAR}references to names the file does not set, short passwords, placeholders still in place, and secrets behindNEXT_PUBLIC_,VITE_orREACT_APP_, which the build ships to every visitor. - Secrets are found by name and by value. Words like SECRET, PASSWORD, TOKEN and KEY; known key formats; a password inside a connection URL; or a long random-looking string. They are masked on screen.
- Take the file you need. The
.env.examplekeeps your comments and order and leaves secret values empty. The fixed.envremoves duplicates and quotes values that need it. JSON and a Docker Composeenvironment:block are one click away.
Questions
- Is my .env file uploaded?
- No. The file is read inside your browser tab and every result is written there. Secret values are masked on screen. Only the optional AI step sends anything, and it sends the variable names and the kind of value each holds (such as number, URL or random-looking), never a value, and only when you press its button.
- Which values does the .env.example keep?
- By default it keeps settings that are safe to commit, such as ports, true or false flags, modes like
development, andlocalhostaddresses, and leaves every other value empty. A connection URL keeps its shape withuser:password@localhostin place of the real login. Under "Values in the example" you can leave every value blank or writeyour-name-hereplaceholders. - How does it decide that a value is a secret?
- From the name (SECRET, PASSWORD, TOKEN, KEY, DSN and similar words) and from the value: known key formats, a password inside a connection URL, or a long string that looks randomly generated. Names that say a key is public, like a publishable or anon key, are not counted.
- Why is a NEXT_PUBLIC_ or VITE_ secret a problem?
- Next.js, Vite, Create React App and similar tools copy every variable with that prefix into the JavaScript sent to the browser, so anyone can read it. A secret there has to move to the server under a name without the prefix, and the key should be replaced, since it may already be public.
- If a name is set twice, which value wins?
- The last one, in Node's dotenv, Docker Compose and python-dotenv. The page names both lines, and the fixed .env keeps the name once, where it first appears, with the value that wins.
- The download is called env.example, without the dot.
- Some browsers will not save a name that starts with a dot. Rename it to
.env.example, or use Copy and paste into a new file.