Naming Style Converter

Convert among camel / Pascal / snake / kebab / CONSTANT styles in one click

Naming-style conversion: the five styles and the traps in between

The five styles

StyleExampleCommonly used for
camelCaseuserLoginCountJS / Java variable and method names
PascalCaseUserLoginCountC# / Java / TypeScript type names
snake_caseuser_login_countPython / Ruby identifiers, database column names
kebab-caseuser-login-countURLs, CSS class names, HTML attributes, file names
CONSTANT_CASEUSER_LOGIN_COUNTThe convention for constants

The tool's process is: first split the input into words, then rejoin them in the target style. So the key to understanding conversion behavior is the word-splitting rule, not the joining.

The word-splitting rule and its boundaries

To split correctly you must first find the word boundaries. The tool uses three rules:

RuleExampleResult
Lowercase or digit followed by uppercase breaks hereuserLoginuser / login
Consecutive uppercase then "uppercase + lowercase" breaks before the last uppercaseHTTPResponsehttp / response
Any non-alphanumeric character is a separatoruser-login_countuser / login / count

The second rule exists specifically for abbreviations. Without it, HTTPResponse would split into h / t / t / p / response, which is plainly wrong. A naive implementation that "breaks before every uppercase letter" ruins every name containing an abbreviation — the most common conversion bug.

Yet even with this rule, some cases are unsolvable:

So conversion is not bidirectionally reversible: userID to USER_ID to userId differs from the original after the round trip. To preserve fidelity, confirm the original style before converting and check the result.

Practical traps during conversion

How to use the tool

Enter an identifier in any style and the tool gives all five styles at once; copy the line you need. Spaces, hyphens, underscores, and dots in the input are all recognized as word boundaries.

It suits deciding the target style when renaming a variable, converting a backend's snake_case field to the frontend's camelCase, and generating a JS identifier from a CSS class name. Conversion runs locally in your browser.

FAQ

How are words split?

First split by separators like underscores, hyphens and spaces, then handle camelCase boundaries (e.g. getUserInfo into user / get / info), unify to lowercase and recombine.

Does it support Chinese identifiers?

No. Naming style conversion targets ASCII alphanumeric identifiers; Chinese is treated as a non-word character and ignored.