camelCase vs snake_case vs kebab-case: Text Case Styles Explained
October 2026 · 5 min read · By Macrae Myint
Text case is more than cosmetics. A variable named userProfile in one language is user_profile in another, a URL slug is written with hyphens, and a headline follows yet another set of rules. This guide lists the common styles, where each is conventionally used, and, because converters are only as good as their rules, exactly what the ToolsForge Text Case Converter does with edge cases such as accents and acronyms.
The same phrase in seven styles
The table below runs the phrase user profile settings page through the converter's own functions. Nothing here is typed by hand.
| Style | Result |
|---|---|
| camelCase | userProfileSettingsPage |
| PascalCase | UserProfileSettingsPage |
| snake_case | user_profile_settings_page |
| kebab-case | user-profile-settings-page |
| SCREAMING_SNAKE | USER_PROFILE_SETTINGS_PAGE |
| Title Case | User Profile Settings Page |
| Sentence case | User profile settings page |
Where each style is conventionally used
- camelCase: variable and function names in JavaScript and Java, and a frequent choice for JSON property names.
- PascalCase: class names in many languages, and React component names, which must start with a capital letter so React treats them as components rather than HTML tags.
- snake_case: Python's PEP 8 style guide recommends lowercase words separated by underscores for functions and variables. It is also common for database column names.
- SCREAMING_SNAKE_CASE: constants (PEP 8 uses it for Python constants) and environment variable names such as
DATABASE_URL. - kebab-case: CSS class names and property names (
font-size), file names, and URL slugs. Google's Search Central guidance on URL structure recommends hyphens rather than underscores to separate words in URLs, because hyphens are treated as word separators. - Title Case and Sentence case: prose. Headlines usually use Title Case; body text, UI labels and many modern style guides prefer sentence case.
These are conventions, not laws. A team's own style guide beats any general rule, so check the project you are contributing to.
Edge cases: what a simple converter gets wrong
Case conversion looks trivial until real text arrives. These results come from the same functions as above, and they show the tool's actual limits rather than a flattering demo:
| Case | Input | Style | Result |
|---|---|---|---|
| Accented letters | café menu | snake_case | caf_menu |
| Acronyms | NASA launches a new probe | Sentence case | Nasa launches a new probe |
| Small words | the lord of the rings | Title Case | The Lord Of The Rings |
| Punctuation | Hello, World! (v2) | kebab-case | hello-world-v2 |
- Non-ASCII letters are dropped in the identifier styles. snake_case, kebab-case and SCREAMING_SNAKE keep only the letters a to z and digits 0 to 9, so an accented letter is treated as a separator. Check the output before using it as a slug.
- Sentence case lowercases everything first. Acronyms and proper nouns inside the sentence lose their capitals and need fixing by hand.
- Title Case capitalizes every word. Many style guides keep short words such as "of" and "the" lowercase, and this converter does not.
- Punctuation becomes a separator. In the identifier styles, runs of punctuation and spaces collapse into a single separator or capital letter.
Using the converter
- Open the Text Case Converter and paste your text.
- Click the style you want. The result appears immediately and you can copy it or download it.
- Skim the result against the edge cases above before using it in code or a URL.
The conversion runs as JavaScript in your browser tab; the text you paste is not sent to a server.
Convert text between cases
Eleven transformations plus live character, word and line counts. Free, no account.
Open Text Case Converter →