.env

What is a .env file?

ENV files store environment variables as key-value pairs — API keys, database URLs, and secrets that should never be committed to git.

Use caution
Type Data
By N/A (developer convention)
MIME text/plain

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

You found a .env file in a project directory. It contains environment variables — key-value pairs like `DATABASE_URL=postgres://localhost:5432/myapp` and `API_KEY=sk-abc123`. These are the configuration values that change between development, staging, and production environments, kept separate from code so they can be managed independently.

The .env convention was popularised by the twelve-factor app methodology and tools like dotenv. Most web frameworks (Node.js, Python, Ruby, PHP) have libraries that load .env files automatically on startup. The critical rule: never commit .env files to version control. They contain secrets — API keys, database passwords, OAuth tokens — that should not exist in your git history. Add `.env` to your .gitignore immediately if it's not already there.

Any text editor opens .env files. VS Code with the DotENV extension provides syntax highlighting. If you need to share environment variables with a teammate, use a secrets manager (1Password, Doppler, AWS Secrets Manager) or a secure channel — not email, not Slack, and definitely not a git commit.

Technical details
Full Name
Environment Variables File
MIME Type
text/plain
Developer
N/A (developer convention)
Magic Bytes
N/A
Safety
.env requires caution. ENV files often contain API keys, passwords, and other secrets. Never share .env files publicly.
What opens it
Any text editor
FREE All
FAQ
Should I commit .env files to git?
No. Never. Add `.env` to your .gitignore. ENV files contain secrets (API keys, passwords) that should not be in version control. If you've already committed one, rotate all the credentials in it immediately — they're in your git history forever.
What's the difference between .env and .env.example?
.env contains actual secrets and should never be committed. .env.example contains the same keys with placeholder values (API_KEY=your-key-here) and IS committed — it documents which environment variables the project needs without exposing real credentials.
Related formats