Identifiers for constants and env vars
CONSTANT_CASE is the identifier style for constants and environment variables in almost every language: MAX_RETRY_COUNT, API_BASE_URL, DATABASE_HOST_NAME. Every word is uppercase, separators are single underscores, no other characters appear. This format avoids visual confusion with regular variables and signals "do not modify" at a glance.
The engine tokenises your input the same way as snake_case, then uppercases the joined result. max retry count becomes max_retry_count in the lowercase pass and MAX_RETRY_COUNT after the final toUpperCase(). Mixed-format input (camelCase, kebab-case, dotted) all produces the same constant.
Where it shows up: const declarations in C, C++, Java, JavaScript, and TypeScript; module-level constants in Python (MAX_INT); environment variable names in Unix shells (HOME, PATH, DATABASE_URL); shell script readonly vars; and many config-file keys. For variables, use snake_case; for class names, use PascalCase.
How to use convert to constant_case
- 1Paste or type your phrase into the input panel on the left.
- 2The CONSTANT_CASE identifier appears in the output panel on the right as you type.
- 3Mixed input is fine:
maxRetryCount,max-retry-count, andmax retry countall produceMAX_RETRY_COUNT. - 4Click Copy in the output header to paste the constant into your code or
.envfile. - 5For variables, use snake_case; for class names, use PascalCase.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
What this tool actually does
Word boundary detection
Same tokeniser as camelCase. Underscores, dashes, whitespace, and lowercase-to-uppercase transitions all count as word boundaries, so any input format produces a consistent constant.
Uppercase final pass
After tokenising and joining with underscores, the engine runs toUpperCase() on the entire string. Every letter is mapped to its Unicode uppercase form, so accented letters become uppercase too (café_size -> CAFÉ_SIZE).
Already-formatted input round-trips
Pasting MAX_RETRY_COUNT back in still produces MAX_RETRY_COUNT. The tokeniser splits on the existing underscores, lowercases each token, joins with underscores, and uppercases the result.
Multiple separators collapse
Runs of underscores, dashes, or spaces collapse to a single underscore. max---retry---count and max__retry__count both produce MAX_RETRY_COUNT.
Pairs with the case family
Sibling tools share the same tokeniser. camelCase for variables, PascalCase for classes, snake_case for lowercase variables, kebab-case for URLs, dot.case for namespacing, Train-Case for headers.
Worked example
Spaces, dashes, and camelCase boundaries all collapse to the same CONSTANT_CASE result. The third line shows that PascalCase input is split on lowercase-to-uppercase transitions before being uppercased.
max retry count api base url DatabaseHostName
MAX_RETRY_COUNT API_BASE_URL DATABASE_HOST_NAME
Settings reference
| Input | CONSTANT_CASE output |
|---|---|
max retry count |
MAX_RETRY_COUNT |
maxRetryCount |
MAX_RETRY_COUNT |
max-retry-count |
MAX_RETRY_COUNT |
max_retry_count |
MAX_RETRY_COUNT |
MAX RETRY COUNT |
MAX_RETRY_COUNT |
maxRetryCount2 |
MAX_RETRY_COUNT2 (digits stick to their word) |
FAQ
Is CONSTANT_CASE the same as SCREAMING_SNAKE_CASE?
Will it work for environment variable names?
How is CONSTANT_CASE different from snake_case?
MAX_RETRY); snake_case is lowercase (max_retry). Both use underscores. Use CONSTANT_CASE for constants and env vars, snake_case for regular variables and functions.Will it handle camelCase input?
maxRetryCount tokenises to max retry count before being joined and uppercased.What about accented letters?
café_size -> CAFÉ_SIZE. If your env-var system rejects non-ASCII, run remove accents on the input first.