Environment Variable Name Generator
Generates an example environment-variable name in UPPER_SNAKE_CASE (e.g. API_SECRET, DB_HOST) — a naming-convention example for config templates and documentation.
What this generator does
Produces variable names in the shape every shell and every container runtime expects: upper case, words joined by underscores, no hyphens and never a leading digit. The convention is not decoration — a name with a hyphen in it cannot be exported by POSIX sh at all, and one starting with a digit is rejected before your program ever sees it.
What it builds, and how many ways
Each result is assembled to this shape: [prefix] + [name].
- name: 22 options
- prefix: 20 options
Taken together those banks can be assembled 440 different ways, repeating after about 26.
Some results it can produce:
- APP_TOKEN
- MAIL_PUBLIC_KEY
- SMTP_KEY
- SEARCH_BUCKET
A fixed sample so this page stays the same between visits. Your own results are assembled at random, each slot filled independently and each press independent of the last, so the same result can come up twice — past the repeat figure above, seeing one twice is more likely than not.
How to use this tool
- Press generate for a variable name.
- Generate again for another one.
Common use cases
- Config-file/template examples
- Teaching environment-variable naming conventions
- Documentation examples
Limitations and good to know
- These are example names for documentation and templates. Nothing here knows what your application actually reads, and a config file full of plausible names it never looks at is worse than an empty one.
- The name is generated; the value is your problem. A secret is a secret whatever the variable is called, and putting the word SECRET in the name protects nothing on its own.
- Some platforms reserve prefixes of their own — anything beginning with a runtime's or a hosting provider's name may be overwritten or refused, and no generator can know which apply to you.
Common mistakes
- Using a hyphen because it reads better
- POSIX sh cannot export a name containing a hyphen, so the variable silently never exists. Underscores are the convention because they are the only separator that works everywhere.
- Encoding the environment in the name
- PROD_DATABASE_URL means every environment needs its own branch in the code that reads it. One name per setting, a different value per environment, is what makes a build artefact portable.
Practical tips
- Prefix by service or component so that a long environment listing stays readable.
- Never commit a real value alongside the name; the name is the safe half of the pair.
- Name the thing, not its type. DATABASE_URL survives a move from Postgres to anything else; POSTGRES_URL has to be renamed in every deployment that reads it.
Each part of the result is chosen independently with your browser's cryptographic random number generator, so every option in a bank is equally likely. How Generate Random works.
Frequently asked questions
- Why upper case with underscores?
- It is a shell convention rather than a rule: lower-case names are conventionally shell-local and upper-case ones exported to the environment, so the case tells a reader which kind they are looking at. Nothing enforces it, and everything expects it.
- Is there a length limit?
- Not a practical one on Linux or macOS, but the whole environment shares a size budget with the command line, and very long names paired with very long values have caused real deployment failures. Readable beats exhaustive.
Related generators
- CSS Class Name GeneratorGenerate an example CSS class name in a common BEM-ish convention, like card__title.
- Database Table Name GeneratorGenerate an example database table name in common snake_case_plural convention, like app_orders.
- User-Agent Example GeneratorGet an illustrative example User-Agent string in the standard format, for testing — not from any real visitor.