Skip to content
hateitall

CONSTANT_CASE Converter

Name constants and environment variables in the capital snake style every shell and config loader accepts.

Processed locallyIn: TextOut: Text

Loading tool…

How to use constant_case converter

  1. Paste setting names or phrases, one per line.

  2. Keep ASCII only on, since environment variable names should be plain ASCII.

  3. Check the warnings for names that start with a digit.

  4. Copy the names into your .env file or code.

What this tool does

  • Turns apiBaseUrl into API_BASE_URL and default-timeout-ms into DEFAULT_TIMEOUT_MS.
  • Drops characters a shell would reject, such as colons, dots and spaces.
  • Uppercases accented letters after converting them to ASCII when that option is on.
  • Flags results that start with a digit, which shells do not accept as variable names.

How the result is verified

The output is split on underscores and compared word for word with the input. Any name beginning with a digit or containing non-ASCII letters is called out.

Frequently asked questions

What characters can an environment variable name contain?

The portable set is capital letters, digits and the underscore, not starting with a digit. That is what POSIX shells accept for variable names, and it is exactly what this converter produces with ASCII only on.

Is CONSTANT_CASE the same as SCREAMING_SNAKE_CASE?

Yes, they are two names for the same style. It is used for constants in Java, Python (PEP 8), Rust and C macros, as well as for environment variables.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

camelCase, headers or phrases to snake_case for Python and SQL

Text→ TextLight on device

Phrases or snake_case names to camelCase, acronym and digit aware

Text→ TextLight on device

Phrases or other cases to dot.case keys for config and i18n

Text→ TextLight on device

Every case at once: upper, lower, title, sentence, camel, snake, kebab and more

Text→ TextLight on device