Skip to content

CONSTANT_CASE Converter

Convert text to CONSTANT_CASE (SCREAMING_SNAKE_CASE). Free converter for constants, environment variables, and .env files.

A CONSTANT_CASE converter uppercases every letter and joins words with underscores, producing names like MAX_RETRY_COUNT. It is the near-universal convention for constants and environment variables.

Examples

InputOutput
max retry countMAX_RETRY_COUNT
databaseUrlDATABASE_URL

When to use the constant_case converter

CONSTANT_CASE — also called SCREAMING_SNAKE_CASE — marks values that never change:

  • Constants in Python, Java, JavaScript, C, Go, and essentially every other mainstream language. It is a convention, not enforcement: Python will happily let you reassign a name written in caps.
  • Environment variables. Shell variables are conventionally uppercase to distinguish them from shell functions and commands, and .env files follow suit.
  • Preprocessor macros in C and C++, where the caps warn the reader that the identifier is not an ordinary function.

The converter handles input in any format — databaseUrl, database-url, or database url all become DATABASE_URL — which makes it the fastest way to turn a config key list into a .env template.

Frequently asked questions

Is CONSTANT_CASE the same as SCREAMING_SNAKE_CASE?

Yes. Both names describe uppercase words joined by underscores. "Constant case" is the more formal term; "screaming snake case" is the widely used informal one.

Do environment variables have to be uppercase?

Not technically — shells accept lowercase names. Uppercase is a long-standing convention that visually separates environment variables from local shell variables and commands.

Does this enforce immutability in my code?

No. It is a naming convention that signals intent to other developers. Use const, final, or your language's equivalent to actually prevent reassignment.