CONSTANT_CASE Converter Online

Transform strings into uppercase CONSTANT_CASE variables and configuration identifiers instantly.

CONSTANT_CASE Converter (SCREAMING_SNAKE_CASE) splits text into words, converts all letters to UPPERCASE, and joins tokens with ASCII underscores (U+005F). For example, database connection timeout (3 words, 27 chars) becomes DATABASE_CONNECTION_TIMEOUT (1 token, 27 chars).

Fixed:
0 Characters
0 Words
0 Sentences
🧹 Remove
🔤 Convert
📑 Format
Copied to clipboard

What Is CONSTANT_CASE (SCREAMING_SNAKE_CASE)?

CONSTANT_CASE is an identifier format where every letter is capitalized and word boundaries are joined with underscores (_), such as MAX_RETRY_COUNT.

CONSTANT_CASE (often called SCREAMING_SNAKE_CASE or UPPER_SNAKE_CASE) is a programmer naming convention where all letters are converted to UPPERCASE and words are separated by underscores (for example, API_SECRET_KEY).

What Regex & Tokenization Rule Does CONSTANT_CASE Use?

The converter extracts alphanumeric word segments (/[\p{L}\p{N}]+/gu, splitting camelCase boundaries /(?<=\p{Ll})(?=\p{Lu})/u) and applies words.map(w => w.toUpperCase()).join("_").

  • Delimiter Replacement: Spaces, hyphens (-), and punctuation between words are replaced by a single underscore (U+005F).
  • Worked Before / After Example: Input database connection timeout\napi secret key\nmax retry count (9 words, 58 characters, 3 lines) → Output DATABASE_CONNECTION_TIMEOUT_API_SECRET_KEY_MAX_RETRY_COUNT (1 constant token, 58 characters, 50 letters uppercased, 8 separators converted to _).
Input Format / Transformation Rule Input Example (Before) Output Result (After) Characters Changed (count)
Plain Words → UPPER_SNAKE_CASE api secret key (14 chars, 3 words) API_SECRET_KEY (14 chars, 1 token) 12 letters uppercased, 2 spaces → _
camelCase → CONSTANT_CASE maxRetryCount (13 chars) MAX_RETRY_COUNT (15 chars) +2 underscores inserted, 11 letters uppercased
kebab-case → CONSTANT_CASE database-timeout-ms (19 chars) DATABASE_TIMEOUT_MS (19 chars) 17 letters uppercased, 2 hyphens → _
PascalCase → CONSTANT_CASE JwtAuthToken (12 chars) JWT_AUTH_TOKEN (14 chars) +2 underscores inserted, 9 letters uppercased

What Are the Standard Conventions for CONSTANT_CASE?

CONSTANT_CASE is universally used in .env configuration files, shell environment variables, and compile-time constants across C, Rust, Python, Java, and JavaScript.

  • Environment Variables: .env files and system environment variables (e.g. DATABASE_URL, NODE_ENV).
  • Global Constants: Constants in JavaScript, Python, C++, Java, and Go to indicate immutable values.
  • Redux Action Types: Action identifiers in state management (e.g. FETCH_USER_SUCCESS).

Is the CONSTANT_CASE Converter Fast, Safe, and Offline?

Yes—all conversions happen locally in your browser so sensitive API key names and environment schemas are never transmitted over the network.

Everything runs on your device. Text Cleaner safely replaces spaces and hyphens with underscores while preserving numbers.

How to use this tool:

  1. Paste or type your text into the editor box above.
  2. Click the highlighted action button to run the transformation instantly on your device.
  3. Click Copy to place the cleaned text onto your clipboard.

More Free Online Text Tools

Cleaning & Stripping
Clean Pasted Text Remove Em Dash Remove Line Breaks Remove Invisible Chars Straighten Quotes Strip HTML Strip Markdown
Case Converters
All 11 Case Converters Sentence Case camelCase Converter snake_case Converter
Formatting & Analytics
Remove Duplicate Lines Alphabetize List Word & Character Counter

Clean text from any app with the Share Sheet.

Select text in Safari, Mail, or Notes and share it to Clean Text. The cleaned version is copied back to your clipboard with a summary of what was fixed.

  • Works inside Safari, Mail, Notes, Word, and Slack
  • Counts and audits damage: '2 em dashes, 3 invisible characters removed'
  • 100% on-device: zero network requests, zero telemetry, full privacy
  • Available on iPhone, iPad, and Mac
Text Cleaner: Case Converter App Screenshot