Use this Environment Variable Manager to generate .env and .env.example files for your applications. .env files store configuration values like database URLs, API keys, and feature flags, keeping them out of source code. This tool helps you create variables with descriptions, mark secrets, and export clean files you can use across development, staging, and production.
Mark any value as secret to exclude it from .env.example. This makes it easy to share a safe template with your team while keeping real credentials private. Start from a template, add your variables, preview the output, then copy or download the resulting files.
Security note
Manage Environment Variables
Add New Variable
Allowed: A-Z, 0-9, underscore. Must not start with a number.
Environment Variables
No Variables Added
Add variables or select a template to get started
What this tool generates
- .env (includes all variables)
- .env.example (excludes secrets, keeps keys + placeholder values)
- Optional comments using the description field
- Copy and download actions
How to generate .env and .env.example
- Select a template (optional).
- Add variables (KEY, VALUE, optional description).
- Mark secrets so they don’t appear in .env.example.
- Preview both files.
- Copy or download .env and .env.example.
- Add .env to .gitignore.
Recommended .gitignore snippet:
.env .env.* !.env.example
Framework examples
Next.js
- Server-only secret: DATABASE_URL
- Client-exposed: NEXT_PUBLIC_API_BASE_URL
React (CRA)
- Client-exposed: REACT_APP_API_URL
Docker Compose
Put .env next to docker-compose.yml and reference variables like ${POSTGRES_PASSWORD}.
Best practices
- Never commit .env files to git.
- Commit .env.example with safe placeholders.
- Use different values per environment (dev/staging/prod).
- Keep variable names consistent across environments.
- Rotate leaked secrets immediately.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| App can’t read variables | dotenv not loaded / framework config not set | Load dotenv early or use framework built-ins |
| Variables missing in client | Wrong prefix | Use NEXT_PUBLIC_ or REACT_APP_ as required |
| Docker Compose not picking .env | Wrong location/name | Place .env beside compose file; avoid quotes |
| Value contains spaces | Needs quoting | Wrap in quotes or escape as needed |
| Multiline values break | Private keys/certs | Base64 encode/decode or use file mounts/secret managers |
Common questions
What is a .env file?
.env files are simple text files that store environment variables for your app in KEY=VALUE format. They’re commonly used for configuration like database URLs, API keys, and feature flags.
Should I commit .env to git?
No. Never commit real secrets. Instead, commit a safe .env.example with placeholder values and keep .env in .gitignore.
What is .env.example and why do teams use it?
.env.example is a template that lists required keys without real credentials. It helps onboarding and prevents accidental secret leaks.
How do I name environment variables correctly?
Use uppercase letters, digits, and underscores (e.g., DATABASE_URL). Avoid spaces and starting with a number.
Next.js: what’s the difference between server and client variables?
Variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Server-only secrets should not use that prefix.
React (CRA): why isn’t my env var available in the browser?
CRA only exposes variables prefixed with REACT_APP_. Other variables are not embedded into the client bundle.
Docker Compose: where should the .env file live?
Place .env next to docker-compose.yml by default. Compose loads it automatically and you can reference variables like ${VAR_NAME}.
What if a value contains spaces or special characters?
You may need quoting depending on how your runtime parses values. When in doubt, wrap in quotes and test in your app/runtime.
How do I handle multiline secrets (private keys, certs)?
Prefer secret managers in production. For local/dev, you can base64-encode multiline values and decode at runtime, or use files mounted via Docker/Kubernetes.
Is this tool uploading my secrets?
No. This tool runs in your browser and generates files locally in the UI (copy/download). Your values are not sent to the server.
Related tools
- Docker Compose Validator — validate compose files that reference env vars
- JSON Formatter — clean and validate JSON configs
- Base64 Encoder/Decoder — encode multiline secrets safely
- Hash Generator — integrity checks for config artifacts