Convert SCREAMING_SNAKE_CASE to kebab-case!

String
Result

Convert SCREAMING_SNAKE_CASE to kebab-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!

Converts environment-variable-style names to kebab-case: LOG_LEVEL → log-level, WORKER_COUNT → worker-count. The two styles often describe the same setting in different places: an env var on one side, a --log-level command-line flag, a Helm value or a Kubernetes ConfigMap key on the other.

Paste a .env file or a list of variables to get the hyphenated, lowercase names used by CLIs and many YAML-based tools.

How to use

  1. Choose SCREAMING_SNAKE_CASE → kebab-case.
  2. Paste the variables into String, with or without their values.
  3. Copy the Result; add -- in front if you need flag syntax.

Example

Input (SCREAMING_SNAKE_CASE)
LOG_LEVEL=debug
CACHE_DIR=/tmp/app-cache
WORKER_COUNT=4
Output (kebab-case)
log-level=debug
cache-dir=/tmp/app-cache
worker-count=4

The names before = are converted; the path /tmp/app-cache already uses hyphens and lowercase, so it is not recognized as SCREAMING_SNAKE_CASE and stays unchanged.

Supported features

  • Lowercases the name and replaces every underscore between segments with a hyphen: CACHE_DIR → cache-dir.
  • Values and paths in the same line are left alone.
  • The leading underscore of a private-style name is dropped: _INTERNAL_FLAG → internal-flag.

Use cases

Exposing env settings as CLI flags

Many tools accept the same option as MYAPP_LOG_LEVEL or --log-level. Converting the env var list helps write the flag definitions and the help text.

Helm and Kubernetes config keys

Helm charts and ConfigMaps often use hyphenated or camelCase keys while containers read SCREAMING_SNAKE_CASE variables. Converting gives the key names for the chart side of that mapping.

Notes and limitations

  • Numeric segments get hyphens like the rest: HTTP_2_ENABLED → http-2-enabled.
  • Single-word variables like PORT are not converted.

FAQ

Can I use the result as environment variable names?

Not portably. Most shells do not allow hyphens in variable names, so keep SCREAMING_SNAKE_CASE for the variables themselves and use kebab-case for flags and config keys.

Does it add the -- prefix?

No. Only the name changes. If the input already has --, it is kept.