Skip to main content
Back to Dev generators

Dev

Environment Variable Name Generator

Configuration variable naming is one of those low-visibility decisions that affects maintainability for the life of a project. The near-universal convention is SCREAMING_SNAKE_CASE with a domain prefix — DB_HOST, API_KEY, STRIPE_SECRET — because it distinguishes env vars from local variables at a glance and groups related settings together visually. This generator produces well-formed names following that convention, useful for populating a .env.example file, scaffolding config for a new service, or generating naming inspiration without reinventing each variable from scratch. The count input controls how many variable names to generate, from 1 to 30. There are no other inputs. Each name is constructed from a prefix (APP, DB, API, AWS, REDIS, SMTP, AUTH, CACHE, LOG, STRIPE) joined to one or two segment words (HOST, PORT, URL, KEY, SECRET, TOKEN, USER, PASSWORD, NAME, REGION, TIMEOUT, ENDPOINT). About 40% of generated names include two middle segments, producing names like AWS_API_ENDPOINT or SMTP_AUTH_TOKEN alongside simpler DB_HOST or APP_PORT names. Duplicate names within a single run are deduplicated. Use the output as a starting list for a .env.example file: keep the names, replace the values with empty strings or placeholder comments, and commit it so teammates know which variables the application expects without committing actual secrets.

Read the complete guide — 4 min read

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Choose how many variable names you want.
  2. Click Generate to produce SCREAMING_SNAKE_CASE names.
  3. Use them in a .env example, config, or documentation.
  4. Adapt the prefixes and names to your actual settings.

Use Cases

  • Placeholder names in a .env example file
  • Scaffolding configuration for a new project
  • Naming environment variables consistently
  • Documentation and tutorial config examples
  • Inspiration for grouping config by prefix

Tips

  • Group related variables under a common prefix for readability.
  • Keep a committed .env.example with names but no real values.
  • Never commit real secrets — store them in a secrets manager.
  • Be consistent: pick a convention and apply it across the whole config.

FAQ

why are environment variables uppercase

The strong convention is SCREAMING_SNAKE_CASE — uppercase words joined by underscores — which distinguishes environment variables from ordinary shell or program variables and is consistent across operating systems and tools. Following it makes a configuration instantly recognisable and predictable.

should I prefix related variables

Yes — grouping related variables under a common prefix like DB_ or STRIPE_ makes a configuration much easier to scan and reason about. A prefix signals which subsystem a value belongs to and helps avoid name clashes between unrelated settings.

where should I store environment variables

In a .env file for local development (kept out of version control) and in a secrets manager or your platform's environment configuration in production. Never commit real secrets to a repository; use placeholder names like these in any committed example file.

does the generator guarantee unique names in a single run

Yes. The generator uses a Set to deduplicate names within a single run, so you will not receive the same variable name twice. If the requested count exceeds the number of unique combinations reachable within the generation limit, the output will contain fewer names than requested.

You might also like

Popular tools from other categories that share themes with this one.

Try these next

More free tools from other corners of the catalog, picked by shared themes.