Skip to main content

CONSTANT_CASE Converter

CONSTANT_CASE, also called screaming snake case, writes a name in capital letters with an underscore between words, as in MAX_RETRY_COUNT. This converter turns plain words or names in another case into CONSTANT_CASE, splitting acronyms and dropping punctuation, with one name per line of input.

Universal Text Transformer

Skip to text input
Try an example:

Input

0/100,000characters0lines

Type or paste text. The output updates as you type.

Output

The converted text appears here as you type.

Words
0
Characters
0
Without spaces
0
Lines
0
Sentences
0
Reading time
0 sec

Each line is converted as its own title, so you can paste a list of headlines.

CONSTANT_CASE Converter examples

CaseInputOutput
Wordsmax retry countMAX_RETRY_COUNT
From camelCaseapiBaseUrlAPI_BASE_URL
From kebab-casedatabase-urlDATABASE_URL
Punctuationtimeout (ms)TIMEOUT_MS
Numbersoauth2 client idOAUTH2_CLIENT_ID
German ßstraße nameSTRASSE_NAME

CONSTANT_CASE Converter rules

  1. Every letter is a capital, and words are joined with one underscore. The German ß becomes SS, following the Unicode case rules your browser applies.
  2. Each line becomes one name, so you can convert a list in one pass. Blank lines are kept.
  3. Spaces, punctuation, symbols, emoji, and the separators of other cases (_ - . /) split words and are removed.
  4. A new word also starts where a lowercase letter or digit meets a capital (getUser is get and User) and at the end of a run of capitals (XMLHttp is XML and Http).
  5. Digits stay with the letters before them, so utf8 and h264 stay whole words. In a name written in capitals, a capital after a digit does not start a new word, so 2FA, MP3, and IPV6 stay whole words.
  6. Acronyms are treated as ordinary words (HTML becomes html or Html), so their capitals are not kept.
  7. An apostrophe inside a word is dropped (don't becomes dont). Accented letters and other alphabets are kept.

How CONSTANT_CASE differs from snake_case

They split words the same way and both use underscores. CONSTANT_CASE writes every letter as a capital (MAX_RETRIES), and snake_case writes every letter in lowercase (max_retries). Try the same text in the snake_case Converter.

How to use

  1. 1

    Type or paste your words, or names in another case, into the editor. Put each name on its own line.

  2. 2

    The CONSTANT_CASE version appears in the output as you type.

  3. 3

    Copy the result into your code, configuration, or file name.

That's it! Your text is transformed and ready to use.

Three simple steps to use CONSTANT_CASE Converter

When to use CONSTANT_CASE Converter

  • Constants

    Module-level constants in Python (PEP 8) and static final fields in Java, both written in capitals with underscores.

  • Environment variables

    Names such as DATABASE_URL. POSIX describes the variables its utilities use as uppercase letters, digits, and underscores.

  • C and C++ macros

    Preprocessor macro names, which are conventionally written in capitals.

FAQ

Is CONSTANT_CASE the same as screaming snake case?

Yes. Both names describe capital letters with underscores between words, as in MAX_RETRY_COUNT.

Can an environment variable name start with a digit?

Shells do not allow it, but this converter keeps digits where they are (2fa secret becomes 2FA_SECRET). Rename the variable if it starts with a digit.

Can I convert many names at once?

Yes. Put each name on its own line. Every line converts to one name, and blank lines stay where they are.

Is my text uploaded anywhere?

The conversion runs in your browser, so your text is not uploaded to a server to be converted.