CONSTANT_CASE Converter
Convert any phrase into CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) — all uppercase letters joined by underscores. Standard for environment variables and constants.
max retry attempts → MAX_RETRY_ATTEMPTS
Convert any phrase into CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) — all uppercase letters joined by underscores. Standard for environment variables and constants.
max retry attempts → MAX_RETRY_ATTEMPTS
CONSTANT_CASE (also widely known as SCREAMING_SNAKE_CASE or UPPER_SNAKE_CASE) is the convention where words are uppercase and joined by underscores. It's the universal style for environment variables, named constants, C/C++ macros, and (historically) enum members.
The visual loudness — all caps plus separators — signals to readers that the value is special: globally scoped, immutable, or compile-time. Most languages don't enforce the convention but every team picks it up because it makes constants distinguishable at a glance.
DATABASE_URL, STRIPE_SECRET_KEY, NODE_ENV. POSIX env-var names are conventionally CONSTANT_CASE; many shells reject lowercase env-var names entirely.
MAX_RETRIES = 3, DEFAULT_TIMEOUT_MS = 5000, PI = 3.14159. Per Python's PEP 8, JavaScript convention, and most C/C++ style guides, top-level constants are CONSTANT_CASE.
#define MAX_BUFFER 4096 — preprocessor macros are CONSTANT_CASE to make them visually distinct from regular identifiers (since they're substituted at compile time, not evaluated like normal code).
Some configuration formats (especially older Unix tools and .env files) use CONSTANT_CASE keys: LOG_LEVEL=debug, HTTP_PORT=8080.
Older C++ and Java code uses CONSTANT_CASE for enum members (OrderStatus.PENDING); modern style guides prefer PascalCase for enum values.
Yes — they're synonyms. "CONSTANT_CASE" is preferred in formal style guides; "SCREAMING_SNAKE_CASE" is the more memorable name programmers actually use in conversation. Both refer to identical output.
For values that look constant but are actually re-assignable (let x = 1 in JavaScript), use the language's variable convention instead. Reserve CONSTANT_CASE for values that are genuinely immutable: literal constants, env-var names, and compile-time macros.
Historical: early Unix shells reserved lowercase names for shell-local variables and uppercase for exported (environment) variables. The convention stuck even after the technical distinction blurred.
POSIX shells allow them, but most tooling (Docker, Kubernetes, CI systems, twelve-factor app config) assumes uppercase. Stick with CONSTANT_CASE to avoid edge-case bugs.