Home โ€บ Case Converter for Developers

Case Converter for Developers

How the conversion works

Each line is first split into words. Word boundaries are detected at spaces, underscores, hyphens, dots and slashes, at a change from a lowercase letter or digit to an uppercase letter (user|Id), and at the end of an acronym followed by a capitalized word (HTTP|Response). The words are then lower-cased and re-joined in the target style. Because of this, any style can be converted to any other: getHTTPResponseCode โ†’ get_http_response_code โ†’ getHttpResponseCode.

Naming conventions by language

StyleExampleTypical use
camelCasemaxRetryCountJavaScript/TypeScript, Java and C# variables and methods, JSON keys
PascalCaseMaxRetryCountClasses and types in most languages, C# methods, Go exported names
snake_casemax_retry_countPython, Ruby, Rust variables and functions, SQL column names
CONSTANT_CASEMAX_RETRY_COUNTConstants and environment variables
kebab-casemax-retry-countURLs, CSS classes, HTML attributes, CLI flags, npm package names
dot.casemax.retry.countConfig keys (Spring, Java properties), i18n message keys

Gotchas

Frequently asked questions

What is the difference between camelCase and PascalCase?

Both join words without separators and capitalize each word, but camelCase starts with a lowercase letter (userId, getHttpResponse) while PascalCase also capitalizes the first word (UserId, HttpResponse). In most languages camelCase is used for variables and functions and PascalCase for classes and types.

Which naming convention should I use in JSON APIs?

There is no single standard. JavaScript and Google APIs mostly use camelCase, while Python, Ruby and many REST APIs (GitHub, Stripe) use snake_case. Pick one per API and stay consistent; most serializers can convert automatically.

How are acronyms like HTTP or ID handled?

The converter treats a run of capitals as one word, so XMLHttpRequest becomes xml_http_request and userID becomes user_id. When converting back to camelCase, acronyms are written like normal words (xmlHttpRequest), which is what most style guides including Google's recommend.