CONSTANT_CASE Converter

Convert camelCase or plain text to CONSTANT_CASE (SCREAMING_SNAKE_CASE) for constants and environment variables. Correct acronym and digit handling.

Example: maxRetryCount → MAX_RETRY_COUNT

Output

Each line is converted separately. Words are split at spaces, punctuation, _ - . / and camelCase boundaries; acronyms such as XML stay together and digits stay attached to the previous word.

Related Tools

View All

What is CONSTANT_CASE?

This tool converts identifiers and phrases to CONSTANT_CASE (also called SCREAMING_SNAKE_CASE): uppercase words joined by underscores, the convention for constants and environment variables.

How to use CONSTANT_CASE

  1. Type or paste text into the Input box – one identifier or phrase per line (or click Load sample).
  2. The converted text appears instantly in the Output box.
  3. Click Copy to copy the result.

Example

Input
maxRetryCount
Output
MAX_RETRY_COUNT

When to use CONSTANT_CASE

Use it for constants in most languages, environment variables and enum members in some styles. For ordinary variables use camelCase or snake_case.

How CONSTANT_CASE works

The input is split into words, every word is upper-cased and the words are joined with _. Words are split at spaces, punctuation and the separators _ - . /, and at case changes inside identifiers: fooBar → foo + Bar, and an acronym run is kept together (XMLHttpRequest → XML + Http + Request). Digits stay attached to the word before them (Request2Go → Request2 + Go), apostrophes inside words are dropped (don't → dont), and letters of any script (é, ñ, Cyrillic, Greek…) are supported. Every line is converted separately.

Common Use Cases

  • Creating environment variable names (API_BASE_URL)
  • Naming constants in JavaScript, Java or Python
  • Converting config keys to env-var style
  • Creating enum member names

Security Note

Everything runs locally in your browser; the code you paste is not uploaded.

FAQs

Is it the same as snake_case in uppercase?

Yes, words are split the same way and joined with underscores in uppercase.

Does it handle kebab-case input?

Yes, api-base-url becomes API_BASE_URL.

What about ß?

Uppercasing follows Unicode rules, so ß becomes SS.

Explore more categories