What Is SCREAMING_SNAKE_CASE? When to Use ALL CAPS with Underscores

3 min read

SCREAMING_SNAKE_CASE (also called CONSTANT_CASE or UPPER_SNAKE_CASE) uses all uppercase letters with underscores as separators: MAX_RETRY_COUNT, API_BASE_URL.

When to Use SCREAMING_SNAKE_CASE

  • Constants: Values that never change at runtime — MAX_CONNECTIONS = 100
  • Environment variables: DATABASE_URL, NODE_ENV, API_KEY
  • Enum values: COLOR_RED, STATUS_ACTIVE (in C, Python)
  • Preprocessor macros: #define MAX_BUFFER_SIZE 1024
  • Global config: DEFAULT_TIMEOUT, MAX_FILE_SIZE

Language Support

LanguageUsed ForExample
PythonModule constantsMAX_RETRY = 3
JavaScriptTrue constantsconst API_URL = "..."
Javastatic final fieldsMAX_SIZE
Rustconst / staticMAX_THREADS
C / C++Macros, constantsBUFFER_SIZE

Convert to SCREAMING_SNAKE_CASE

Use our constant case converter or case converter hub.