Advertisement

Constant case converter

Convert any text to CONSTANT_CASE, the all-caps underscore style used for constants and environment variables.

Constant Case

Paste text below and get CONSTANT_CASE output instantly.

Advertisement

How CONSTANT_CASE works

CONSTANT_CASE, also called SCREAMING_SNAKE_CASE, uppercases every letter and joins words with underscores: max retry count becomes MAX_RETRY_COUNT. It signals that a value is a fixed constant in almost every language.

Handles any input format

camelCase, kebab-case, spaced, and mixed input are split into words first, then uppercased and joined. databaseUrl becomes DATABASE_URL, ready to use as an environment variable name.

Constant Case FAQs

What is CONSTANT_CASE used for?
Environment variables (DATABASE_URL), configuration keys, enum values, and true constants (MAX_RETRIES = 3). The all-caps style makes them visually distinct from regular variables.
Is this the same as SCREAMING_SNAKE_CASE?
Yes, the two names describe the same style. Some teams also call it MACRO_CASE or UPPER_SNAKE_CASE.
How do I name an environment variable from a phrase?
Paste the phrase in, for example api secret key, and you get API_SECRET_KEY, which follows the standard convention for .env files and server configuration.
Does it keep numbers?
Yes. Digits stay where they are, so oauth2 token becomes OAUTH2_TOKEN.
Is my text sent to a server?
No. The conversion runs entirely in your browser with JavaScript. Nothing you paste ever leaves your device.
Advertisement