Skip to content

.env file checker

Free, no sign-up Runs in your browser

Paste a .env file and see which values are real secrets, default passwords or risky settings such as DEBUG=true. Secrets are shown redacted.

Checked as you type. Nothing you paste leaves this page, and secrets are shown redacted.

The file is read in your browser. It is not uploaded.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the .env file checker

  1. Paste the contents of the .env file, drop it, or load the example.
  2. For each real secret, confirm the file is in .gitignore and .dockerignore.
  3. Replace real values with placeholders in the copy you commit as .env.example.
  4. Rotate any secret that has been in git, in an image or in a chat.

About this tool

A .env file keeps configuration out of the code, which is good practice, and it is also the file that leaks most often: committed by mistake, copied into a Docker image, attached to a support ticket. Before you share one, or before you commit a .env.example, it helps to know exactly which lines are live credentials.

This checker separates real values from placeholders. It recognises the documented formats of provider keys (AWS, GitHub, Stripe, OpenAI, Anthropic, Google and others), generated-looking values under secret-sounding names, private keys, and database URLs with a password in them. It also reports settings that are unsafe in production: debug flags, a development environment name, default passwords, wildcard CORS origins and NODE_TLS_REJECT_UNAUTHORIZED=0.

Nothing you paste leaves the page, and a finding never repeats a secret: you see the name, a redacted value and its length. The checks are pattern rules, so a secret with no recognisable shape can pass. Treat a clean result as a good sign and not as proof, and look at the values yourself before you share the file.

Sources

Questions

Should a .env file be committed to git?

No. Commit a .env.example with the variable names and placeholder values, and add .env to .gitignore. Real values belong on the machine that runs the app or in a secret manager.

I committed a .env file. Is deleting it enough?

No. The file stays in the repository’s history, in clones and in forks. Rotate every secret that was in it first, because that is the only step that makes the leaked values useless, and then remove the file from history if you need to.

What does NODE_TLS_REJECT_UNAUTHORIZED=0 do?

It tells Node.js to accept any TLS certificate on every outgoing connection in the process. Anyone on the network path can then read and change the traffic. If a server uses a private certificate authority, set NODE_EXTRA_CA_CERTS to that CA instead.

Is a database URL with a password in it a problem?

It is a credential like any other, with the extra habit of being logged: connection strings turn up in error messages and startup logs. Keep it out of version control, and prefer a secret manager or separate host, user and password variables where the driver allows it.

Related tools