Convert SCREAMING_SNAKE_CASE to snake_case!

String
Result

Convert SCREAMING_SNAKE_CASE to snake_case!

Is the variable naming in the code you copied from somewhere else different from your code? Don't worry! It converts variables to your desired naming convention!

Lowercases SCREAMING_SNAKE_CASE names and keeps the underscores: SESSION_COOKIE_AGE → session_cookie_age. Same words, same separators, only the case changes.

This direction comes up when constants or environment variables have to become ordinary variables, dictionary keys, database columns or YAML/TOML settings, for example moving Django-style settings into a pydantic model or turning a list of env vars into config file keys.

How to use

  1. Use SCREAMING_SNAKE_CASE on the left and snake_case on the right.
  2. Paste the constants, settings or env var names into String.
  3. Copy from Result.

Example

Input (SCREAMING_SNAKE_CASE)
SESSION_COOKIE_AGE = 1209600
EMAIL_HOST_USER = "noreply@example.com"
_INTERNAL_TOKEN_TTL = 60
Output (snake_case)
session_cookie_age = 1209600
email_host_user = "noreply@example.com"
_internal_token_ttl = 60

The three setting names are lowercased; the e-mail value and the numbers are unchanged, and _INTERNAL_TOKEN_TTL keeps its leading underscore as _internal_token_ttl.

Supported features

  • Lowercases letters and keeps every underscore, including ones before digits: HTTP_2_ENABLED → http_2_enabled.
  • A single leading underscore is preserved.
  • Upper-case words without underscores (DEBUG, True) are not matched.

Use cases

From Django settings to a pydantic model

Settings like EMAIL_HOST_USER become fields named email_host_user on a BaseSettings class, and pydantic still reads the upper-case environment variable because matching is case-insensitive by default.

Env vars into a YAML config

When a service moves from many environment variables to one config.yaml, the lowercased names are the usual keys in that file.

Notes and limitations

  • Since both styles use the same separators, this conversion is lossless and can be reversed exactly.
  • Every upper-case underscore word in the paste is affected, including SQL constants such as CURRENT_TIMESTAMP if they appear in the text.

FAQ

Why not just use my editor's lowercase command?

That lowercases everything, including values, string contents and keywords like True. This page changes only the SCREAMING_SNAKE_CASE identifiers.

Is DEBUG converted?

No, a name needs at least one underscore to be matched. Lowercase it yourself.