Part of Case converters
CONSTANT_CASE converter: environment variables and shared constants
Paste a plain-English phrase, camelCase field, or kebab-case flag name and copy the underscored uppercase token into your `.env` file, config map, or code generator output.
How to use this converter
- Enter a label with spaces, hyphens, dots, or mixed capitals.
- Review acronym segments (API vs Api) against your team convention.
- Copy into env files, feature flags, or generated constant blocks.
When should you use CONSTANT_CASE?
Use it for environment variables, shared constants, and enum-like values in many languages. JavaScript `const` variables in application code usually stay camelCase—reserve screaming snake for values loaded from the environment or shared across services.
Do not use CONSTANT_CASE for SQL table names (often snake_case lowercase) or URL slugs (kebab-case).
CONSTANT_CASE vs snake_case
Same underscore separator, different height: `max_retry_count` for everyday Python variables and columns; `MAX_RETRY_COUNT` for constants and env vars. Many codebases use both in the same repository with clear rules.
Environment files and twelve-factor apps
`.env` files conventionally use uppercase keys so they stand apart from application variables. When importing a spreadsheet of “Max Retry Count,” convert mechanically, then grep your repo for duplicates before committing.
Common mistakes
Naming every JavaScript `const` in CONSTANT_CASE—linters will complain.
Checking secrets into git even when the key name looks official—this tool only formats text.
Mixing `API_KEY` and `api_key` for the same setting across environments.
Before and after examples
Verify secrets policy before committing env files.
| Original | Converted | Notes |
|---|---|---|
| max retry count | MAX_RETRY_COUNT | Plain phrase |
| apiBaseUrl | API_BASE_URL | From camelCase |
| feature-flag-dark-mode | FEATURE_FLAG_DARK_MODE | From kebab-case |
| order line item | ORDER_LINE_ITEM | Enum-style name |