Constant Case Converter

Convert any text to CONSTANT_CASE (SCREAMING_SNAKE_CASE). The standard for constants, env vars, and configuration keys.

Try:

Options

What Is Constant Case (SCREAMING_SNAKE_CASE)?

Constant case, also known as SCREAMING_SNAKE_CASE or UPPER_SNAKE_CASE, uses uppercase letters with underscores between words: MAX_RETRY_COUNT, API_BASE_URL, DATABASE_HOST.

It is the universal convention for constants, configuration values, and environment variables across virtually all programming languages.

Where Constant Case Is Used

  • Constants in Python, Java, C, C++, JavaScript, Go, Rust
  • Environment variables (NODE_ENV, DATABASE_URL)
  • Preprocessor macros in C/C++ (#define MAX_BUFFER_SIZE)
  • Enum values in many languages
  • Docker environment variables
  • GitHub Actions and CI/CD secrets
  • .env file keys

Constant Case by Language

LanguageExampleUsed For
PythonMAX_CONNECTIONS = 100Module-level constants
JavaScriptconst API_KEY = "..."Constants, config
Javastatic final int MAX_SIZE = 50Class constants
C/C++#define BUFFER_SIZE 1024Macros, constants
Rustconst MAX_THREADS: u32 = 8Constants
GoMaxRetries = 3Exported constants (PascalCase in Go)

Constant Case vs snake_case

Both use underscores as separators. The only difference is letter case: constant case is ALL UPPERCASE (MAX_VALUE), while snake_case is all lowercase (max_value). This visual distinction immediately tells developers whether a name is a constant or a variable.

FAQ

Why are constants uppercase?

The convention dates back to C programming, where preprocessor macros (which could not be changed at runtime) were written in uppercase to distinguish them from regular variables. The pattern became universal across languages.

Related Tools