SCREAMING_SNAKE_CASE Converter

Convert text to UPPER_SNAKE_CASE for constants and env vars

Convert any phrase, camelCase, or kebab-case string into SCREAMING_SNAKE_CASE. Uppercases each word and joins them with underscores — the universal convention for constants and environment variable names. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is SCREAMING_SNAKE_CASE?

SCREAMING_SNAKE_CASE writes a name in all uppercase with underscores between words, like MAX_RETRY_COUNT. It is the near-universal convention for constants in code and for environment variable names in shells and config files.

SCREAMING_SNAKE_CASE — all uppercase with underscores — is the standard way to name constants in code and environment variables in shells and config files. This converter rewrites any phrase or identifier into that format.

How it works

The input is split into a list of word tokens, each token is uppercased, and the tokens are joined with underscores. Boundaries come from separators and from case transitions in camelCase or PascalCase input:

"max retry count" -> MAX_RETRY_COUNT
"maxRetryCount"   -> MAX_RETRY_COUNT
"max-retry-count" -> MAX_RETRY_COUNT
"databaseUrl"     -> DATABASE_URL

Every detected word is uppercased before joining, so the result is always a valid, uppercase, underscore-separated constant name.

Where SCREAMING_SNAKE_CASE is used — and where it is not

The convention is near-universal for a small set of specific situations:

  • Environment variablesDATABASE_URL, STRIPE_SECRET_KEY, API_BASE_URL. Both POSIX shells and Docker/Kubernetes env configs treat all-caps as the de facto standard. Mixing cases here causes subtle bugs: on Linux Port and PORT are two different variables.
  • Compile-time constants — C macros (#define MAX_BUFFER_SIZE 4096) and Rust constants (const MAX_RETRY_COUNT: u32 = 5) use this form by convention. The uppercase visually signals “this value does not change at runtime.”
  • Enum members in some languages — Java and older Python codebases use SCREAMING_SNAKE_CASE for enum values; modern Python (3.11+) StrEnum and Rust enums prefer PascalCase, so check your language’s style guide.
  • Configuration keys in shell scripts — if you are writing a .env file loaded by dotenv, bash source, or a CI/CD pipeline, uppercase is expected.

Do not use SCREAMING_SNAKE_CASE for function names, local variables, class names, or filenames — those contexts each have their own conventions.

Common mistakes

  • Abbreviations: if your phrase includes an abbreviation like “HTTP” or “URL”, the converter keeps it as-is. httpStatusCode becomes HTTP_STATUS_CODE. Verify the result reads as you expect.
  • Numbers and version strings: a phrase like v2 api endpoint may tokenise the 2 as a separate fragment. Review the output and manually merge the digit into the adjacent word if your style guide requires V2_API_ENDPOINT rather than V_2_API_ENDPOINT.
  • Leading/trailing underscores: some conventions reserve a leading underscore (_INTERNAL_ONLY) for private or internal constants. The converter does not add one — append it manually if your codebase uses that pattern.

Tips and notes

This format clearly signals immutability, which is why it is reserved for constants and configuration. On Unix-like systems environment variable names are case sensitive, so keeping them uppercase avoids collisions between names that differ only in case. Letters and digits are separated during tokenisation; rejoin a segment like a version number after copying if you prefer it attached.