About this tool
CONSTANT_CASE, also called SCREAMING_SNAKE_CASE, writes words in capitals joined by underscores: MAX_RETRY_COUNT. It marks values that never change, such as constants in JavaScript, Java, C, Python and PHP, and it’s the universal style for environment variables (DATABASE_URL, API_BASE_URL). Paste names in any style, one per line.
| Case | Example | Typical use |
|---|---|---|
| camelCase | userProfileId | JavaScript, Java and C# variables and functions; JSON keys |
| PascalCase | UserProfileId | Classes and types in most languages; C# methods; React components |
| snake_case | user_profile_id | Python, Ruby and Rust variables; database columns |
| kebab-case | user-profile-id | URLs, CSS classes, HTML attributes, file names, CLI flags |
| CONSTANT_CASE | USER_PROFILE_ID | Constants and environment variables |
How words are detected
Input can be in any style: spaces, snake_case, kebab-case, camelCase or PascalCase. Words are split at spaces, underscores, hyphens and other punctuation, at lowercase-to-uppercase changes (userId → user, Id), and at acronym boundaries (XMLHttpRequest → XML, Http, Request). Each line is converted separately, so you can paste a whole list of names at once. Letters with accents and non-Latin scripts are kept.
Environment variable names
POSIX shells only reliably accept letters, digits and underscores in variable names, and names can’t start with a digit. CONSTANT_CASE fits those rules, which is why .env files, Docker, Kubernetes and CI systems all use it. Many frameworks map nested settings with a double underscore: Logging__LogLevel__Default in .NET, for example.
Examples
maxRetryCount → MAX_RETRY_COUNT
api-base-url → API_BASE_URL
HTTPTimeoutSeconds → HTTP_TIMEOUT_SECONDS
stripe secret key → STRIPE_SECRET_KEY
FAQ
What is CONSTANT_CASE?
Uppercase words joined by underscores, like MAX_RETRY_COUNT. It is used for constants and environment variables.
Is CONSTANT_CASE the same as SCREAMING_SNAKE_CASE?
Yes, they are two names for the same style.
How do I convert camelCase to CONSTANT_CASE?
Paste the names, one per line. maxRetryCount becomes MAX_RETRY_COUNT.
Why do environment variables use CONSTANT_CASE?
Shells accept only letters, digits and underscores in variable names, and uppercase names avoid clashing with ordinary shell variables, which are lowercase by convention.