Environment Variable Manager

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

Do not paste production secrets into tools you don’t trust. This tool runs in your browser and generates the output locally in the UI (copy/download). For production, prefer a dedicated secrets manager (Vault, AWS Secrets Manager, GCP Secret Manager, etc.).

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

  1. Select a template (optional).
  2. Add variables (KEY, VALUE, optional description).
  3. Mark secrets so they don’t appear in .env.example.
  4. Preview both files.
  5. Copy or download .env and .env.example.
  6. 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

ProblemCauseFix
App can’t read variablesdotenv not loaded / framework config not setLoad dotenv early or use framework built-ins
Variables missing in clientWrong prefixUse NEXT_PUBLIC_ or REACT_APP_ as required
Docker Compose not picking .envWrong location/namePlace .env beside compose file; avoid quotes
Value contains spacesNeeds quotingWrap in quotes or escape as needed
Multiline values breakPrivate keys/certsBase64 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