SCREAMING_SNAKE_CASE converter
SCREAMING_SNAKE_CASE — also called CONSTANT_CASE or UPPER_SNAKE_CASE — uppercases every letter and joins words with underscores: PARSE_XML_FILE, MAX_RETRIES, DATABASE_URL. Across almost every language it carries one meaning: this value does not change. Python, Java, C, C++, Rust, Go, Ruby and JavaScript all use it for constants, which makes it one of the few conventions that survives crossing between languages intact.
Environment variables are the other domain, and there the convention is close to a hard rule. POSIX specifies that portable environment variable names use uppercase letters, digits and underscore, and must not start with a digit — so DATABASE_URL is portable and database-url is not even expressible in most shells, since the hyphen breaks the assignment syntax. Every .env file, Dockerfile ENV, CI secret and Kubernetes env entry follows it.
One trap worth naming: some shells and libraries treat leading-underscore names specially, and a name colliding with a standard variable (PATH, HOME, USER, LANG, TERM) will be quietly overwritten or will break the tools that depend on it. Prefix application variables — APP_DATABASE_URL rather than DATABASE_URL — when a process runs alongside anything else that reads the environment.
SCREAMING_SNAKE — worked through
Every line below is produced by the same converter that runs on this page, so the example and the tool cannot disagree.
| Input | SCREAMING_SNAKE | Note |
|---|---|---|
| parse xml file | PARSE_XML_FILE | The canonical shape of this style. |
| parse the XML file from the ERP API | PARSE_THE_XML_FILE_FROM_THE_ERP_API | Acronym preservation on — the converter’s default. |
| parse the XML file from the ERP API | parseTheXMLFileFromTheErpAPI | Converted back to camelCase. Listed acronyms are restored; anything not on the list returns as an ordinary word. |
Where SCREAMING_SNAKE is the convention
| Ecosystem | What it applies to |
|---|---|
Environment variables | POSIX-portable names are uppercase, digits and underscore, not starting with a digit. Hyphens cannot be used at all — the shell cannot express NAME-WITH-HYPHEN=value. |
Python | PEP 8 module-level constants. Python does not enforce immutability, so the case is the only signal that a name is not meant to be reassigned. |
Java / C / C++ | static final fields, #define macros and enum members. Long-standing enough that a lowercase macro looks like a bug to most readers. |
JavaScript / TypeScript | Module-level constants and enum members. Note that const only prevents rebinding — the case tells a reader the value is conceptually fixed, which const alone does not. |
The acronym trap
Everything is uppercase, so acronyms disappear as a problem in the output — XML, ERP and API all read naturally in PARSE_XML_FILE. The ambiguity is entirely in the reverse conversion, and it depends on the word list: DATABASE_URL becomes databaseURL with acronym preservation on and databaseUrl with it off, because URL is a known initialism, while MAX_RETRIES gives maxRetries either way. An in-house acronym nobody has listed always comes back capitalised as an ordinary word. Decide which convention your codebase uses before round-tripping environment variable names into config objects, rather than discovering it in a diff.
مرحبا بالعالم. The Unicode slug keeps the original script.FAQ
Why are environment variables uppercase?
POSIX reserves uppercase names for the shell and utility environment, and portable variable names are limited to uppercase letters, digits and underscore. It is also practical: hyphens cannot appear in a shell assignment at all.
What is the difference between SCREAMING_SNAKE_CASE and CONSTANT_CASE?
Nothing — different names for the same style. UPPER_SNAKE_CASE is a third. All mean uppercase words joined by underscores.
Should every constant use this style?
For module-level and truly fixed values, yes — it is the near-universal signal. Local values that happen not to change usually stay in the language’s ordinary variable style; shouting at every line makes the signal worthless.