Constant Case Converter

Turn any text into 'CONSTANT_CASE' for env vars and constants.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

This converter turns any text into CONSTANT_CASE — also called SCREAMING_SNAKE_CASE — where every word is uppercase and joined by underscores, like MAX_RETRY_COUNT. It is the conventional format for environment variables and named constants across many languages, so this tool is handy for normalising config keys and defining constants.

How it works

The converter detects word boundaries in your input regardless of its original style. It inserts a split before each uppercase letter (keeping acronyms intact), then splits on any non-alphanumeric separator such as spaces, hyphens and underscores. Each resulting word is uppercased, and the words are joined with _. This means plain text, camelCase, PascalCase, snake_case and kebab-case all convert cleanly.

Example

InputOutput
max retry countMAX_RETRY_COUNT
myVariableNameMY_VARIABLE_NAME
api-base-urlAPI_BASE_URL
parseHTMLStringPARSE_HTML_STRING

So api-base-url becomes API_BASE_URL, ready to drop into a .env file. Everything runs in your browser, so your code never leaves your machine.

Ad placeholder (rectangle)