CONSTANT_CASE Converter

CONVERT TEXT TO CONSTANT_CASE — UPPERCASE with underscores. Also called SCREAMING_SNAKE_CASE. The constants convention in most languages.

Input
Output

What is CONSTANT_CASE?

CONSTANT_CASE (also called SCREAMING_SNAKE_CASE, MACRO_CASE, or simply UPPER_SNAKE_CASE) uses all uppercase letters with underscores between words. It's the convention for compile-time constants, environment variables, and preprocessor macros in most languages.

The visual loudness signals "this value doesn't change at runtime" — useful for spotting magic numbers, configuration keys, and API tokens at a glance.

When to use CONSTANT_CASE

  • Compile-time constants in C, C++, Java, C#, Python, Ruby, JavaScript.
  • Environment variablesDATABASE_URL, API_KEY, MAX_RETRIES.
  • C macros and preprocessor directives#define MAX_BUFFER_SIZE 1024.
  • Configuration keys in ini-style files.
  • Enum members in some style guides — though many languages now prefer PascalCase for enum members.
  • HTTP header names in CGI variables — HTTP_USER_AGENT.

How CONSTANT_CASE conversion works

  1. Input is tokenized using the smart tokenizer.
  2. Each word is uppercased.
  3. Words are joined with a single underscore between them.

Worked examples

Input CONSTANT_CASE
max retry count MAX_RETRY_COUNT
api base url API_BASE_URL
default timeout DEFAULT_TIMEOUT
is production mode IS_PRODUCTION_MODE

Related case formats

Need more conversion options?

Open the full converter →