Detect text case style
Naming conventions make identifiers and labels predictable, but inconsistent text can slip into source code, configuration, imports, and generated content.
Run — free
This case detector examines the exact characters you provide and reports whether they follow camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Train-Case, dot.case, path/case, Title Case, Sentence case, or a simple upper- or lowercase form. It performs strict, deterministic matching, so the same input always receives the same result and ambiguous or irregular text is clearly marked as mixed.
Understand what the detector checks
The detector compares your complete input with a defined set of naming patterns. It does not merely count capitals or look for one separator. For camelCase, the text must begin with lowercase letters and contain at least one capitalized word boundary. PascalCase begins with a capital and joins subsequent words without separators. Snake, constant, kebab, dot, and path styles require at least two nonempty segments separated consistently by underscores, hyphens, periods, or forward slashes. Space-separated text is checked for Title Case, Sentence case, lowercase words, and uppercase words. A successful result includes the recognized style and a short reason. If punctuation, inconsistent separators, unexpected capitals, or surrounding whitespace prevents an exact match, the result is mixed instead of making a misleading guess. This strict behavior is especially useful in validation because it distinguishes a convention that is actually followed from text that only resembles it. Digits are accepted within many identifier segments, while empty input and non-string values are rejected as invalid input rather than classified.
Use exact detection for convention validation
A style label becomes most useful when it is part of a repeatable quality check. Send an identifier from a form, data pipeline, code generator, or naming audit and compare the returned style with the convention your project expects. For example, an API field policy may require snake_case, while a JavaScript property policy may require camelCase. A mixed result tells you that the input needs review, but the detector deliberately does not rewrite it. Keeping detection separate from conversion prevents an automated check from silently changing public names, database columns, or keys that may already be referenced elsewhere. The response also includes a recognized boolean, which makes branching straightforward: accepted named conventions return true, while irregular text returns false. Exact matching means leading and trailing whitespace matters; this catches invisible copy-and-paste problems before identifiers enter a system. When you need to process many values, call the capability once per item and store both the original value and detected style in your validation report. That creates an auditable result and lets a human decide whether exceptional names are intentional.
Interpret boundaries and ambiguous inputs
Case names can overlap when an input contains only one word, so this detector uses practical precedence and avoids claiming word boundaries that are not present. A single lowercase token is reported as lowercase, not camelCase, because camel case normally demonstrates at least one joined capitalized segment. Likewise, one uppercase token is UPPERCASE rather than CONSTANT_CASE. Multiword separated forms are more specific: customer_order_id is snake_case, CUSTOMER_ORDER_ID is CONSTANT_CASE, and Customer Order Id is Title Case. Sentence case requires an initial capital followed by lowercase space-separated words, while Title Case requires each word to begin with a capital. Acronym-heavy strings, Unicode letters, apostrophes, commas, doubled separators, and combinations such as snake-Case are returned as mixed when they do not exactly fit a supported pattern. That conservative outcome is intentional: guessing a familiar label could allow a malformed identifier through a validator. The algorithm is local and analytic, with no network requests, language model, randomness, or time-dependent behavior. Browser checks are available on the page, and API automation costs $0.002 per item.
What you can do with it
Enforce API field names
Check that incoming or generated field names follow the snake_case or camelCase convention required by an API contract.
Audit configuration keys
Classify keys from configuration files and flag mixed forms before inconsistent names spread across environments.
Validate generated identifiers
Test code-generator output deterministically without changing identifiers or hiding malformed boundaries.
FAQ
Which case styles are recognized?
The detector recognizes camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Train-Case, dot.case, path/case, Title Case, Sentence case, lowercase, uppercase, lowercase words, and uppercase words.
Why is one lowercase word not camelCase?
A single lowercase word has no joined word boundary, so it is classified as lowercase. camelCase requires at least one capitalized boundary after the lowercase beginning.
Does it convert text to another case?
No. It only detects the current style. Separating detection from conversion makes validation safer and keeps the original input unchanged.
What happens with inconsistent separators or capitals?
The result is mixed with recognized set to false, because the text does not exactly follow one supported convention.
How much does the API cost?
Each API request costs $0.002. The browser version on this page can run locally without an API call.
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/detect-case \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"customerOrderId"}'const res = await fetch("https://api.kit.forhosting.com/str/detect-case", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "customerOrderId"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/detect-case",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "customerOrderId"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/detect-case", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"customerOrderId"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"customerOrderId"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/detect-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": "customerOrderId"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.detect_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.
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. |