TextyConverterbeta
⌘K

CONSTANT_CASE Converter

Convert any string to CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) — uppercase words joined by underscores.

0 characters
0 characters

About CONSTANT_CASE Converter

CONSTANT_CASE (also known as SCREAMING_SNAKE_CASE or UPPER_SNAKE_CASE) is used for constants, macros, environment variable names, and other 'shouty' identifiers across C, C++, Python, JavaScript, and shell scripts. Words are uppercased and joined with underscores.

When to use it

  • Naming environment variables (DATABASE_URL, API_TOKEN)
  • Defining constants in JavaScript or Python (MAX_RETRIES)
  • Writing C/C++ preprocessor macros
  • Producing shell-style identifiers from human-readable labels

How it works

The input is split into words via the standard boundary detection (whitespace, separators, camelCase transitions, acronym boundaries, digit boundaries). Each word is uppercased and joined with an underscore.

Examples

max retries
MAX_RETRIES
camelCase → CONSTANT_CASE
databaseUrl
DATABASE_URL

Frequently asked questions

When should I use CONSTANT_CASE?
Constants whose value doesn't change at runtime (configuration values, magic numbers, environment variables). For variables that change, use camelCase or snake_case depending on language convention.
Is this the same as SCREAMING_SNAKE_CASE?
Yes — both names refer to the same convention. 'CONSTANT_CASE' emphasizes the intended use; 'SCREAMING_SNAKE_CASE' is more descriptive of the visual form.

Related tools