ForHosting KIT · Developer Utilities

Identifier naming case detector

Type a name from your code and see which convention it follows: getUserName is camelCase and splits into get, user and name. It also spots PascalCase, snake case, kebab-case and the all-capitals form, and always returns the words in lowercase. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
getUserName
You get
Identifier
getUserName
Case style
camelCase
Words
get, user, name
Word count
3

Renaming tools, style linters, and code-mod pipelines cannot rewrite a symbol until they know which convention that symbol already uses. Each style hides word boundaries in a different place: interior capitals, underscores, or hyphens. This identifier naming case detector inspects one identifier, names the convention, and returns the component words in lowercase so a caller can rebuild the same name in another style without guessing. The algorithm is a deterministic character scan: no model, no network, and no clock.

How each naming style hides its word boundaries

A name in code glues several words into one symbol, and each convention marks the joins in a different place. camelCase starts in lowercase and capitalizes each later word, so getUserName splits into get, user and name. PascalCase does the same but starts with a capital, the usual shape of type names and classes: HttpServer is http plus server. Snake case joins lowercase words with underscores, as in Python functions and many SQL columns. Kebab-case uses hyphens and shows up in CSS classes and web addresses. The all-capitals form with underscores, such as MAX_RETRY_COUNT, is kept for constants and environment settings.

How the detector decides, and when it says mixed

It looks at separators first and letter case second. Underscores alone mean snake case, or its all-capitals form; hyphens alone mean kebab-case. With no separators, a lowercase start plus a later capital is camelCase, and a capital start plus a later lowercase letter is PascalCase. A single lowercase word such as user is reported as lower, and a single capital word such as OK as upper. When underscores and hyphens, or underscores and interior capitals, meet in one name, the answer is mixed. Leading underscores used for privacy are ignored before the style is named.

What identifier case detection means and how each style is recognized

Identifier naming case is the convention a programming language community uses to glue several English words into one symbol. camelCase starts with a lowercase letter and marks each later word with a capital, which is why getUserName reads as get, user, and name once the capitals are treated as boundaries. Classification looks at separators first, then letter case. A name that contains both underscores and hyphens is mixed.

Hyphen-separated lowercase parts are kebab-case. With no separators, a leading lowercase letter plus a later capital is camelCase, and a leading capital plus a later lowercase letter is PascalCase. The point of the page is detection plus a stable word list, not conversion: dedicated converters already exist for turning a phrase into one target style.

Which identifier naming cases does this detector recognize?

Single-token names return lower or upper. Combined separators or mixed letter case return mixed.

How are component words produced from an identifier?

The engine splits on underscores and hyphens, then on camelCase edges (lowercase or digit to uppercase, acronym to Titlecase, and letter to digit). Tokens are lowercased in the words array.

What happens to a leading underscore such as _foo_bar?

The identifier field still echoes the original spelling, and empty dunder holes are not kept as words.

What is the difference between camelCase and PascalCase?

Only the first letter. camelCase starts in lowercase, as in getUserName, while PascalCase starts with a capital, as in HttpServer. Both mark every later word with a capital letter instead of a separator.

Does the detector convert a name into another style?

No. It names the style the identifier already uses and returns its words in lowercase, such as get, user and name, so you can rebuild the same name in any other convention without guessing where each word ended.

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.

POSThttps://api.kit.forhosting.com/dev/identifier-case-detect

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.

curl -X POST https://api.kit.forhosting.com/dev/identifier-case-detect \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"getUserName"}'
{
  "text": "getUserName"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.identifier_case_detect",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars4096
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

An identifier such as getUserName is camelCase; UserProfile is PascalCase; http_status_code is snake_case; content-type is kebab-case; and MAX_RETRY_COUNT is SCREAMING_SNAKE_CASE. Empty, missing, or illegal identifiers fail with invalid_input instead of a silent empty split. Successful API calls are billed at $0.002; validation failures are not charged.

What identifier case detection means and how each style is recognized

PascalCase, also called UpperCamelCase, starts with a capital and is the usual shape of type names, React components, and C# classes: HttpServer is http plus server. snake_case writes every letter in lowercase and joins words with a single underscore, the default for Python functions, Ruby methods, and many SQL columns. kebab-case does the same job with hyphens and appears in CSS classes, URL slugs, and HTTP header names such as content-type. SCREAMING_SNAKE_CASE is snake_case in full capitals and is reserved for constants and environment keys such as MAX_RETRY_COUNT. This detector also reports three honest extras that renaming tools meet every day: lower for a single lowercase token such as user, upper for a single capital token such as OK, and mixed when underscores, hyphens, and interior capitals are combined in one symbol, for example get_userName. Underscore-separated lowercase parts are snake_case; the same parts in capitals are SCREAMING_SNAKE_CASE. Leading underscores used for privacy or Python dunders are stripped before the style is named so _foo_bar stays snake_case and __init__ stays snake_case, while the returned identifier still echoes the original spelling.

Input contract, word splitting, and error behaviour

Length is capped at four thousand ninety-six characters: a longer paste fails with an explicit limit message rather than a silent cut. The identifier must start with a letter, underscore, or dollar sign and then use only ASCII letters, digits, underscores, or hyphens. Leading or trailing hyphens and consecutive hyphens are rejected because they are not legal names in the languages this tool is built for. At least one letter is required: a token made only of digits or symbols has no naming case to detect. There is no locale-specific title casing and no partial success that drops tokens without saying so. POST a JSON body with one required field, text, holding the identifier to inspect. Aliases identifier, name, value, and input are accepted so spreadsheets, query strings, and typed forms can reuse the same contract without renaming a column. The value must be a non-empty string after trim; numbers, booleans, objects, and arrays are rejected so a mistaken JSON body cannot become the word true or an object dump. On success the body returns five stable fields. identifier echoes the trimmed input so you can audit what was classified. case_style is one of camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE_CASE, lower, upper, or mixed. words is the ordered array of lowercase tokens after splits at underscores, hyphens, a lowercase-or-digit to uppercase edge, an acronym followed by a Titlecase word, and letter-to-digit or digit-to-letter edges, so XMLHttpRequest becomes xml, http, and request, and getUser2FA becomes get, user, 2, and fa. word_count is the length of that array. readable joins the words with single spaces for labels and logs. Missing text, an empty string, and an illegal character set fail with invalid_input naming the field; those failures are not billed.

Where renaming tools, linters, and migrations use a case detector

A rename refactor is unsafe if the tool assumes every symbol is already camelCase. Documentation generators turn the readable phrase into headings and accessibility labels while still knowing the original convention for cross links. Failed validation does not consume balance. Keep requests to one identifier, pin the words array in tests, and you get a reproducible classification for rename pipelines, lint rules, and classroom checks without standing up a parser generator of your own. Front-end codebases mix React components in PascalCase, hooks in camelCase, CSS modules in kebab-case, and environment constants in SCREAMING_SNAKE_CASE; a detector that returns both the style and the words lets a codemod rebuild getUserName as get_user_name or GetUserName without a human pointing at each file. Backend migrations face the same split between Python snake_case functions, HTTP kebab-case headers, and Java PascalCase types when an OpenAPI document, an ORM model, and a client SDK must stay aligned. Style linters and review bots can flag a function that arrived as Http_Server instead of guessing whether the author meant snake_case or PascalCase. Teachers and coding-interview platforms can ask a student to name the style of ten identifiers and mark the answer against this oracle instead of a spreadsheet macro that treats UserID and user_id as the same string.

Safe rename and codemod pipelines

Classify each symbol before rewriting it so a codemod can turn camelCase into snake_case or PascalCase without assuming the source style.

Lint rules for mixed codebases

Flag functions, types, CSS classes, and constants that arrived in the wrong convention by comparing case_style to the rule for that kind of symbol.

Docs and classroom oracles

Split identifiers into readable words for headings, and mark student answers that name camelCase, snake_case, or SCREAMING_SNAKE_CASE.

What input is rejected as invalid?

Missing text, an empty string, non-strings, names with spaces or other illegal characters, leading or trailing hyphens, consecutive hyphens, letter-free tokens, and payloads longer than four thousand ninety-six characters fail with invalid_input.

What does the identifier naming case detector cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →