CONSTANT_CASE Converter
About this tool
About CONSTANT_CASE Converter
CONSTANT_CASE, also called UPPER_SNAKE_CASE or SCREAMING_SNAKE_CASE, writes every word in capitals joined by underscores: MAX_UPLOAD_SIZE, DATABASE_URL, ORDER_STATUS_SHIPPED. It marks values that never change, so it is the convention for constants in JavaScript, Java, C, Python and Rust, for enum members in many languages, for C preprocessor macros, and above all for environment variable names in .env files, Docker, CI pipelines and cloud dashboards. Paste a list of config keys in camelCase from a settings object, or plain words from a spec, and get the matching environment variable names ready for a .env.example file. Acronyms and digits are handled: apiBaseURL becomes API_BASE_URL and oauth2ClientId becomes OAUTH2_CLIENT_ID. Each line converts separately, and the other cases are shown alongside in case you need the camelCase form for the code that reads them. Everything happens in your browser, so internal setting names stay private.
Built and maintained by Abhi JainUpdated
How to Convert Text to CONSTANT_CASE
- 1
Paste names
Paste setting names or words into the Text box, one per line.
- 2
Read the CONSTANT_CASE result
CONSTANT_CASE is selected, so the converted names appear under the Text box.
- 3
Copy
Copy or download them for your code or .env file.
CONSTANT_CASE Converter: questions and answers
What is CONSTANT_CASE?
Uppercase words separated by underscores, like RETRY_LIMIT. It is the same as snake_case but in capitals, which is why it is also called UPPER_SNAKE_CASE or SCREAMING_SNAKE_CASE.
Why are environment variables written in uppercase?
By long Unix convention, uppercase names are reserved for environment and shell variables shared between programs, while lowercase names are left for local shell variables. POSIX environment variable names use uppercase letters, digits and underscores.
Can an environment variable name start with a digit?
No. Most shells require names to start with a letter or underscore. If a converted name starts with a digit, add a prefix such as APP_.
When should I use CONSTANT_CASE in JavaScript?
For true module-level constants whose value is fixed and known ahead of time, such as const MAX_ITEMS = 50. Ordinary const variables that hold computed values usually stay camelCase.
More Case Converter presets
Related tools
- Slug GeneratorTurn titles into clean URL slugs with accent transliteration and length limits.
- Whitespace Visualizer & CleanerReveal tabs, NBSP, zero-width characters and mixed line endings, then clean them.
- Regex TesterTest JavaScript regular expressions live with highlighted matches, capture groups, replace preview and plain-English errors.
- JSON FormatterBeautify, minify and validate JSON with exact error locations, without changing a single value.