DuckyTools
Home Text CONSTANT_CASE Converter

CONSTANT_CASE Converter Text

Turn any phrase into SCREAMING_SNAKE_CASE for constants and env vars.

CONSTANT_CASE Converter is a free online tool that turn any phrase into SCREAMING_SNAKE_CASE for constants and env vars. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free: no account, no quota, no watermark
Category
Text
Where it runs
In your browser, on your device
Files uploaded
None
Technology
plain JavaScript
Settings
None, it just works
Works offline
Yes, after the first visit

About CONSTANT_CASE Converter

CONSTANT_CASE (uppercase words joined by underscores) is the near-universal convention for compile-time constants and, more practically, for environment variables. POSIX restricts portable environment variable names to uppercase letters, digits and underscores, and requires that they not start with a digit, which is exactly what this produces.

How to use it

  1. Paste the text you want to run through constant_case converter.
  2. There is nothing to configure: the result updates as you type.

Under the hood

Runs onplain JavaScript: runs the whole thing

Questions

Why must environment variables be uppercase?

Convention rather than a hard rule on most systems, but a strong one: it distinguishes them from shell variables at a glance, and POSIX reserves the lowercase namespace for applications. Windows environment variables are case-insensitive; Unix ones are not.

What happens to a name starting with a number?

It converts, but the result is not a valid identifier in most languages or a portable environment variable name. Add a prefix.