How to use
- Paste an identifier or short phrase (from
camelCase,snake_case,kebab-case, plain words, or any mix), or a whole list, one per line: each line is converted on its own. - Read the six results: camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case and dot.case, computed together from the same word boundaries. Each row says where that style is conventionally used, if you are not sure which one you need.
- Press Copy on a row (Copy all for a list, one per line).
- Load sample inserts a worked example; Clear empties the box.
One phrase, every case style at once
Programming languages and style guides disagree on how to write a multi-word name: JavaScript variables are camelCase, classes are PascalCase, Python and database columns are snake_case, environment variables and constants are CONSTANT_CASE, URLs and CSS classes are kebab-case, and config keys sometimes use dot.case. Converting between them by hand is mechanical and easy to get subtly wrong around acronyms and numbers; this tool does the tokenising once and shows every style at the same time.
Example
The phrase userFirstName becomes:
userFirstName
UserFirstName
user_first_name
USER_FIRST_NAME
user-first-name
user.first.nameReading the result
- camelCase: first word lowercase, each following word capitalised, no separator. The JavaScript/Java/C# convention for variables and function names.
- PascalCase: every word capitalised, no separator. The convention for classes, types and React components.
- snake_case: all lowercase, joined by underscores. Python's convention for variables and functions, and common for database columns.
- CONSTANT_CASE: all uppercase, joined by underscores. The convention for constants and environment variables.
- kebab-case: all lowercase, joined by hyphens. The convention for URLs, CSS class names and command-line flags.
- dot.case: all lowercase, joined by dots. Seen in some config file keys and namespaced identifiers.
Edge cases and common errors
- No recognisable words. Input made only of separators, like
___---..., has nothing to tokenise and shows an error rather than six empty boxes. - Already in the target style is a no-op. Converting
userFirstNameto camelCase returnsuserFirstNameunchanged; the tool tokenises first and rebuilds, so a correctly-cased input round-trips exactly. - Acronyms next to a lowercase letter split correctly (
getUserID→get,User,ID), but brand-style casing with no lowercase-to-uppercase rule to detect, likeiOS, does not. See the FAQ. - A single word with no boundary is unaffected by camelCase, snake_case or kebab-case (there is nothing to split or join), but CONSTANT_CASE and PascalCase still change its letter case.
- Non-Latin letters and emoji are kept as their own token (split at the nearest separator) rather than dropped, but the acronym/camelCase boundary detection only understands the Latin-letter case rules used above; mixed-script identifiers may need a manual check.
Do the same thing in code
// lodash
_.camelCase('user_first_name'); // 'userFirstName'
_.snakeCase('userFirstName'); // 'user_first_name'
_.kebabCase('userFirstName'); // 'user-first-name'
# Python
"user_first_name".title().replace("_", "") # crude PascalCase, no acronym handlingMost languages' standard libraries do not include a full case converter: lodash (JavaScript) is the closest widely-used equivalent, and even it does not handle every acronym case this tool does.