snake_case to CONSTANT_CASE converter

Turn snake_case names into capitals while keeping the underscores between words.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter snake_case names (one per line or inside text).
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each snake_case name is split into words at the underscores, and at any capital that follows a lowercase letter. The words are then upper-cased and joined with underscores (_). Symbols and spaces around the names are left as they are. Example: max_retry_count becomes MAX_RETRY_COUNT.

Example

Result: CONSTANT_CASE result: MAX_RETRY_COUNT API_BASE_URL DEFAULT_TIMEOUT; Names processed: 3.

max_retry_count
api_base_url
default_timeout
MAX_RETRY_COUNT
API_BASE_URL
DEFAULT_TIMEOUT

Limits and caveats

  • Every word in the pasted text is converted, including keywords and library names, so review the result before pasting it into code.
  • Characters not allowed in environment variable names, such as Arabic or accented letters, are not removed.

Questions about this tool

Why are environment variables written in capitals?

POSIX states that the environment variables used by its utilities consist of uppercase letters, digits and underscores only, and that became the common habit in .env files.

How is this different from plain uppercasing?

For a clean snake_case name the result is the same, but the tool also splits words that run together, so db_hostName becomes DB_HOST_NAME.

Are the values after = in a .env file changed?

Yes, every word is converted, so paste the variable names alone without their values.