Convert to CONSTANT_CASE
hello world becomes HELLO_WORLD and get-user-profile becomes GET_USER_PROFILE: every word in capitals, joined by underscores, with no spaces, hyphens or dots left. The usual shape for environment variables, constants and feature flags. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- hello world
- Text
- HELLO_WORLD
- Original
- hello world
- Length
- 11
- Words
- 2
This convert-to-CONSTANT_CASE tool takes a non-empty phrase and returns a single SCREAMING_SNAKE_CASE identifier: every word is uppercased and words are joined with underscores, with no spaces, hyphens, or dots left in the result. CONSTANT_CASE is the everyday shape of environment variables, compile-time constants, configuration keys, feature flags, and many language style guides that reserve ALL_CAPS for values that must stay stable across builds. Feed it spaced titles, camelCase properties, kebab-case CSS class roots, dotted package fragments, or mixed punctuation, and the engine rebuilds one deterministic CONSTANT_CASE string. Nothing is guessed from a model, nothing is fetched over the network, and nothing depends on the clock or random seeds.
Where CONSTANT_CASE conversion fits in study, publishing, and software
Teachers can pre-generate answer keys that show the expected CONSTANT_CASE form without trusting opaque spreadsheet macros that change locale rules mid-file. Backend and DevOps developers use CONSTANT_CASE for process environment keys, Docker Compose variables, Kubernetes secrets naming conventions, feature-flag identifiers, and compile-time constants in C, Go, and Rust style guides. Integration teams convert legacy CSV column titles into stable SCREAMING_SNAKE_CASE keys before configuration loaders and secret managers freeze the contract.
Mobile and cross-platform apps map human labels into shared constant identifiers that bridge native modules and JavaScript bridges. Support and operations teams paste noisy ticket subjects or release codenames into CONSTANT_CASE so dashboards and runbooks share one identifier shape. Pair it with camelCase, uppercase, or encode tools when you are building a small lab of free, deterministic text helpers for forms, env prep, and data hygiene.
What you can do with it
Normalize environment and config keys
Turn spaced headers, camelCase properties, and kebab labels into stable CONSTANT_CASE keys for env files, Docker Compose, and secret managers.
Feature flags and compile-time constants
Convert human phrases into CONSTANT_CASE flag names and language-level constants before wiring backends, CI, or native modules.
FAQ
What does the convert-to-CONSTANT_CASE tool cost?
It is free in your browser on this page.
What happens if I send an empty string?
Empty text is not a valid conversion; provide a non-empty phrase with at least one alphanumeric character.
Which separators become underscores?
Spaces, hyphens, dots, and other non-alphanumeric runs are treated as word breaks. Words are uppercased and joined with single underscores; existing underscores already act as breaks.
Is CONSTANT_CASE the same as camelCase?
No. camelCase lowercases the first word and removes separators. CONSTANT_CASE uppercases every word and joins them with underscores (SCREAMING_SNAKE_CASE).
Is the result the same every time for the same input?
Yes. The transform is pure and deterministic: no network, no randomness, and no clock. The same phrase always yields the same CONSTANT_CASE string.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/constant-case \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"hello world"}'const res = await fetch("https://api.kit.forhosting.com/str/constant-case", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "hello world"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/constant-case",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "hello world"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/constant-case", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"hello world"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"hello world"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/constant-case", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "hello world"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.constant_case",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Empty input and separator-only strings fail with a clear invalid_input error so a blank form cannot look like a successful conversion. Use it free in the browser for naming drills, env-file prep, and data cleanup, or call the API at $0.002 per successful request when CI, form pipelines, or teaching demos need the same CONSTANT_CASE result every time.
What CONSTANT_CASE conversion means and what the response contains
CONSTANT_CASE conversion turns a multi-word phrase into one identifier where every letter is uppercase and words are separated by single underscores, with no spaces or other punctuation between them. The transform is not camelCase (which would leave the first word lower and remove separators), not PascalCase, not kebab-case, and not a slug that keeps hyphens: only the SCREAMING_SNAKE_CASE spelling remains. There is no partial mode that only uppercases an already-joined string without re-tokenizing, no locale-specific title rules, and no silent coercion of null into an empty success. In practice hello world becomes HELLO_WORLD, user_id becomes USER_ID, get-user-profile becomes GET_USER_PROFILE, and a dotted fragment such as order.line.item becomes ORDER_LINE_ITEM. This calculator returns five stable fields: text holds the CONSTANT_CASE result you will copy into code, an env file, or a schema; original echoes the exact input string so you can audit what was transformed; length reports the character count of the result; words counts how many tokens were joined; and method is the fixed tag to_constant_case for logs and multi-tool pipelines. The engine either builds a complete CONSTANT_CASE string inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, whitespace-only or separator-only payloads that leave no alphanumeric tokens, objects and arrays that are not plain text, and any payload longer than the documented maximum character count.
How the text field is read and how the result stays reproducible
The value must be a non-empty string; finite numbers and bigints are stringified first so a bare numeric code still becomes a CONSTANT_CASE token after conversion to decimal digits. Leading and trailing whitespace are trimmed before tokenization; internal runs of spaces, underscores, hyphens, dots, and other non-alphanumeric characters act as word breaks and become single underscores in the output only between tokens. Existing camelCase or PascalCase boundaries are expanded so XMLHttp Request and getUserID both split into sensible words before reassembly. Each token is uppercased in full, which keeps helloWorld, HELLO_WORLD, and hello-world on the same HELLO_WORLD result after tokenization. The preferred field is text, but aliases input, string, value, content, s, and phrase are accepted so query strings, spreadsheets, and typed forms can reuse the same contract without renaming columns. Booleans, plain objects, and arrays are rejected with a clear message so a mistaken JSON body does not become the word TRUE or an unhelpful object dump. Empty string is always invalid_input: the product promise is convert a phrase, not invent a blank success. Length is capped at one hundred thousand characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. Pair the free browser run on this page with the priced API when you need the identical CONSTANT_CASE result inside an automated pipeline without shipping your own string helpers.
Where CONSTANT_CASE conversion fits in study, publishing, and software
Students meet CONSTANT_CASE when a coding exercise demands environment variable names that match a style guide, when a data-entry lab cleans spreadsheet headers into config keys, or when a systems class renames camelCase API fields into shell-safe ALL_CAPS tokens. On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the string result.
Integration use cases
Deterministic constant fixtures
Generate reproducible SCREAMING_SNAKE_CASE identifiers for unit tests, golden files, and CI assertions on naming and transform code.