
Case Converter
Convert text between 12 different case formats. Paste your text and pick a style. 100% client-side.
Last reviewed: April 2026New to this tool? Click here for instructions
Quick Answer
A case converter changes the capitalization of text between formats β UPPERCASE, lowercase, Title Case, Sentence case β and programming styles like camelCase, snake_case, and kebab-case. Paste your text above and pick a case to convert it instantly. It is handy for renaming variables or cleaning up copy, and your text stays local in your browser.
How to Use the Case Converter
To use the Case Converter, simply paste your text into the input area on the left (or top on mobile). Choose a case format by clicking one of the 12 format chips above the panes. The converted text will appear instantly on the right. You can copy or download the result using the buttons above the output.
When to Use the Tool in Real Workflows
The Case Converter is ideal for developers, writers, and content creators who need to convert text between different case formats. It's particularly useful when working with programming languages, file names, titles, and more.
How It Works
The Case Converter uses a smart splitting algorithm to detect word boundaries in any input format. It recognizes spaces, hyphens, underscores, and dots as explicit separators. For camelCase and PascalCase inputs, it detects boundaries where a lowercase letter is followed by an uppercase letter. This ensures accurate conversion between any two formats.
Tips, Edge Cases, or Limitations
For programming, match the convention of your language. CSS class names should use kebab-case. When naming database tables and columns, snake_case is the most portable format. Title Case is ideal for headings, but small words like 'and', 'the', 'of' are typically not capitalized in formal title style.
Frequently Asked Questions
Instantly convert text between camelCase, snake_case, PascalCase, kebab-case, and five other naming conventions β entirely in your browser. Paste any identifier, phrase, or mixed-style string and get all eight output formats simultaneously, with one-click copy for each.
What This Tool Does
The Case Converter accepts any text β separated by spaces, underscores, hyphens, or camelCase/PascalCase transitions β and outputs eight standard naming formats: camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE_CASE, Title Case, UPPERCASE, and lowercase. All tokenisation and recombination runs in your browser tab β no server, no account, no rate limit. Paste getAuthenticationTokenForUser or HTTP response handler and the tool figures out the word boundaries automatically, regardless of which style you started with.
How to Use It
Step-by-step instructions
- Paste or type your text into the input textarea above.
- All eight output formats render instantly in the output pane.
- Click the chip label for the target case style to highlight and select that output.
- Hit the Copy button next to the desired result β the converted string is now on your clipboard.
- Use the Try Example button at any time to load a pre-filled realistic payload and explore the outputs before committing your own input.
Worked example: camelCase input
Start with a function name from a typical auth service:
- Input
getAuthenticationTokenForUser- Source style detected
- camelCase
The tokeniser splits on the camelCase transitions, producing the word list [get, authentication, token, for, user], then recombines into each target format:
| Output Format | Result | Typical Context |
|---|---|---|
| camelCase | getAuthenticationTokenForUser | JS/TS function or variable |
| PascalCase | GetAuthenticationTokenForUser | Class or constructor name |
| snake_case | get_authentication_token_for_user | Python function name |
| kebab-case | get-authentication-token-for-user | CSS class / REST URL path |
| SCREAMING_SNAKE_CASE | GET_AUTHENTICATION_TOKEN_FOR_USER | Python / C constant |
| Title Case | Get Authentication Token For User | UI label / heading |
| UPPERCASE | GETAUTHENTICATIONTOKENFORUSER | Legacy systems |
| lowercase | getauthenticationtokenforuser | Normalised comparison |
getAuthenticationTokenForUser.Worked example: natural-language input with spaces
Clear the input and paste HTTP response handler β a space-separated phrase with a leading acronym. Select snake_case: the output pane shows http_response_handler. The consecutive-uppercase run HTTP is treated as a single word token and lowercased as a unit, so you never see h_t_t_p_response_handler. Selecting camelCase yields httpResponseHandler; PascalCase yields HttpResponseHandler; kebab-case yields http-response-handler. The acronym-collapsing behaviour is deliberate and consistent with how the Regex Tester handles identifier patterns β more on the algorithm in the section below.
The 8 Case Formats Explained
camelCase
The first word is entirely lowercase; each subsequent word starts with a capital letter and the rest is lowercase. No separator character. Example: getUserToken. The name comes from the visual humps created by internal capitals. Dominant in JavaScript, TypeScript, Java, Swift, and Kotlin for variable and function names.
PascalCase
Also called UpperCamelCase. Every word, including the first, starts with a capital letter. Example: GetUserToken. Used for class names and constructors in most object-oriented languages β Java, C#, TypeScript, Swift, and Python alike. The Google JavaScript Style Guide reserves PascalCase for constructor functions and ES6 classes.
snake_case
All letters lowercase, words joined by underscores. Example: get_user_token. PEP 8 mandates snake_case for Python function names, variable names, and module names. Ruby follows the same convention. SQL column names are almost universally snake_case by community convention (user_id, created_at).
kebab-case
All letters lowercase, words joined by hyphens. Example: get-user-token. Standard for CSS class names (.nav-bar), HTML custom data attributes, and REST URL slugs (/user-accounts/auth-token). Hyphens are not valid in most programming-language identifiers, which is why this style stays out of source code but dominates the web layer.
SCREAMING_SNAKE_CASE
snake_case with every letter capitalised. Example: GET_USER_TOKEN. PEP 8 recommends this for module-level constants in Python. The C and C++ communities use it for macro definitions and preprocessor constants. The advantage over plain UPPERCASE is that word boundaries are preserved: MAX_RETRY_COUNT is immediately readable; MAXRETRYCOUNT is not.
Title Case
Each word's first letter is capitalised, spaces preserved. Example: Get User Token. Used for UI headings, button labels, navigation items, and documentation titles. Not suitable as a programming identifier because of the embedded spaces, but useful for display strings generated from programmatic names.
UPPERCASE
Every character capitalised, spaces preserved if present. Example: GET USER TOKEN. Useful for normalising strings before comparison, generating SQL keywords, or satisfying legacy systems. Included for completeness rather than as a named-identifier convention.
lowercase
Every character lowercased, spaces preserved. Example: get user token. Common as a preprocessing step before tokenisation or slug generation, and for case-insensitive string matching. The URL Slug Generator starts with this transform before adding hyphens.
| Format Name | Appearance | Primary Use Case | Language / Context | Example Token |
|---|---|---|---|---|
| UPPERCASE | ALL CAPS, spaces kept | Normalisation, SQL keywords | SQL, legacy systems | GET USER TOKEN |
| lowercase | all lowercase, spaces kept | String comparison, preprocessing | Universal | get user token |
| Title Case | Each Word Capitalised | UI labels, headings | Documentation, UI copy | Get User Token |
| camelCase | firstWordLower, RestCap | Variables, functions | JavaScript, Java, Swift | getUserToken |
| PascalCase | EveryWordCapitalised | Classes, constructors | Python, JS, C#, Java | GetUserToken |
| snake_case | all_lowercase_underscores | Variables, functions, DB columns | Python (PEP 8), Ruby, SQL | get_user_token |
| kebab-case | all-lowercase-hyphens | CSS classes, URL slugs | CSS, HTML, REST APIs | get-user-token |
| SCREAMING_SNAKE_CASE | ALL_CAPS_UNDERSCORES | Constants, macros | Python, C, C++, env vars | GET_USER_TOKEN |
When to Use Each Case Style in Code
Python (PEP 8)
PEP 8 is explicit: function names and local variables use snake_case (get_user_token), class names use PascalCase (UserTokenService), and module-level constants use SCREAMING_SNAKE_CASE (MAX_RETRIES). Following these rules is not merely convention β linters like flake8 and pylint flag violations, and pull-request reviewers in most Python projects will reject non-compliant names.
JavaScript and TypeScript
The Google JavaScript Style Guide specifies camelCase for variable names, function names, and method names, and PascalCase for class names and constructor functions. TypeScript inherits these conventions and adds PascalCase for interface and type alias names. Constants can be either camelCase or SCREAMING_SNAKE_CASE depending on whether they are module exports intended as configuration values.
CSS and HTML attributes
MDN's CSS documentation and the BEM methodology both use kebab-case for class names (.nav-bar, .primary-button__icon) and CSS custom properties (--primary-color, --font-size-base). camelCase is not valid in CSS selectors without escaping β a .navBar rule parses without error but is unusual and unsupported by most frameworks. Stick with kebab-case to stay compatible with PostCSS, Sass, and CSS Modules defaults.
Database column names
SQL itself is case-insensitive for keywords, but column names conventionally follow snake_case: user_id, created_at, last_login_ip. This matters when ORMs like SQLAlchemy or ActiveRecord map database columns to Python or Ruby objects β both expect snake_case column names and auto-translate to camelCase at the application boundary.
REST API design and URL slugs
Most API design guides β including the Google API Design Guide β recommend kebab-case for URL path segments (/user-accounts/auth-token) because hyphens improve readability and search engines treat hyphenated slugs as word separators. Query parameter names are typically camelCase or snake_case depending on the ecosystem, but path segments should stay kebab-case for maximum URL readability.
| Context | Recommended Case | Authority / Source |
|---|---|---|
| Python variable / function | snake_case | PEP 8 |
| Python class | PascalCase | PEP 8 |
| Python constant | SCREAMING_SNAKE_CASE | PEP 8 |
| JavaScript variable / function | camelCase | Google JS Style Guide |
| JavaScript / TypeScript class | PascalCase | Google JS Style Guide |
| CSS class / custom property | kebab-case | MDN / BEM |
| URL path segment / slug | kebab-case | Google API Design Guide |
| SQL column name | snake_case | Community convention |
| Environment variable | SCREAMING_SNAKE_CASE | POSIX / 12-factor app |
Edge Cases and Gotchas
Acronyms and initialisms (HTTP, XML, ID)
A consecutive run of uppercase letters like HTTP or XML is treated as a single word token, not split letter-by-letter. So HTTPServer tokenises to [http, server], producing http_server in snake_case β not h_t_t_p_server. This matches the strategy used by the change-case npm package and aligns with Go's naming conventions, where acronyms in exported names are kept together (HTTPServer, not HttpServer).
Numbers inside identifiers
Digits attach to the adjacent token rather than triggering a new word boundary on their own. getUserV2Token becomes get_user_v2_token in snake_case β the digit cluster 2 stays with v as a single token v2. A boundary is only inserted when a digit is immediately followed by an uppercase letter, so XMLParser2Response tokenises to [xml, parser2, response] and converts to xml_parser2_response. Try the Try Example button if your identifiers follow version-suffix patterns.
Unicode and non-ASCII characters
Unicode letters (Γ©, Γ±, ΓΌ, Γ―) are preserved in their original case within each token. A word like cafΓ© survives the round-trip intact. Characters that are neither letters nor digits β punctuation marks, currency symbols, brackets β are treated as delimiters and stripped during tokenisation. The output tokens will never contain them. Leading or trailing whitespace and empty lines in the input are silently discarded; this is intentional behaviour, not a bug.
Already-mixed inputs
An input like my-component_name mixes hyphens and underscores. The tokeniser treats both as delimiters, splitting into [my, component, name] before any output format is applied. There is no need to clean up your input before pasting β the tool handles compound delimiters without double-counting boundaries.
How the Converter Detects Word Boundaries
Tokenisation strategy
Word boundaries are identified by four distinct signals: whitespace characters, underscore characters, hyphen characters, and camelCase/PascalCase transitions (an uppercase letter immediately preceded by a lowercase letter, or the start of a new consecutive-uppercase run). After all boundary positions are identified, the string is split into raw tokens. Every token is then lowercased before recombination, so the source case style has no effect on the final output.
Regex pattern used
The core split is conceptually equivalent to:
// Split on camelCase transitions, acronym boundaries, and separators
str.split(/(?<=[a-z\d])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|[\s_\-]+/)
The first alternative ((?<=[a-z\d])(?=[A-Z])) catches standard camelCase transitions like getUser β [get, User]. The second ((?<=[A-Z])(?=[A-Z][a-z])) handles acronym-to-word boundaries like HTTPServer β [HTTP, Server]. The third catches whitespace, underscores, and hyphens as explicit delimiters. This is the same boundary-detection strategy documented in the change-case npm package, one of the most widely depended-on string utilities on the npm registry. After splitting, each token is lowercased and the array is recombined using the joiner and capitalisation rules of the target format.
Case Conversion in Different Programming Languages
Python: re and str methods
A quick one-liner for camelCase β snake_case in Python using the standard library:
import re
snake = re.sub(r'(?<!^)(?=[A-Z])', '_', 'getUserToken').lower()
# Result: 'get_user_token'
That naive pattern misses acronym boundaries β it would split HTTPServer into h_t_t_p__server. For production code, the inflection package's underscore() function handles consecutive caps correctly and is worth the dependency for anything beyond trivial scripts.
JavaScript: one-liners with replace()
Converting camelCase to snake_case in JavaScript:
const toSnake = str =>
str
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
.toLowerCase();
toSnake('getUserV2Token'); // 'get_user_v2_token'
toSnake('HTTPResponseCode'); // 'http_response_code'
For camelCase β kebab-case, swap the replacement string from '$1_$2' to '$1-$2'. Lodash provides _.camelCase(), _.snakeCase(), and _.kebabCase() which wrap similar logic with broader Unicode support β a better choice in any project that already has Lodash as a dependency.
SQL: LOWER() and REPLACE()
SQL has no native naming-convention transform, but you can normalise a display string for use as a column alias at query time:
SELECT REPLACE(LOWER('Get User Token'), ' ', '_') AS col_alias;
-- Result: 'get_user_token'
Real identifier transformations β such as generating migration column names from model attributes β are handled at the application layer by ORMs or schema migration tools, not inside SQL itself.
| Language / Framework | Variable Names | Class Names | Constants | File Names |
|---|---|---|---|---|
| Python | snake_case (user_token) | PascalCase (UserToken) | SCREAMING_SNAKE_CASE (MAX_RETRY) | snake_case (auth_utils.py) |
| JavaScript | camelCase (userToken) | PascalCase (UserToken) | SCREAMING_SNAKE_CASE (MAX_RETRY) | kebab-case (auth-utils.js) |
| TypeScript | camelCase (userToken) | PascalCase (UserToken) | SCREAMING_SNAKE_CASE (MAX_RETRY) | kebab-case (auth-utils.ts) |
| Ruby | snake_case (user_token) | PascalCase (UserToken) | SCREAMING_SNAKE_CASE (MAX_RETRY) | snake_case (user_token.rb) |
| Go | camelCase (userToken) | PascalCase (UserToken) | PascalCase (MaxRetry) | snake_case (auth_utils.go) |
| Java | camelCase (userToken) | PascalCase (UserToken) | SCREAMING_SNAKE_CASE (MAX_RETRY) | PascalCase (UserToken.java) |
| CSS / SCSS | kebab-case (.user-token) | kebab-case (.user-token) | kebab-case (--max-retry) | kebab-case (_auth-utils.scss) |
| SQL | snake_case (user_token) | N/A | SCREAMING_SNAKE_CASE (MAX_RETRY) | snake_case (user_tokens.sql) |
Full Worked Example
Inputs
- Input string 1
getAuthenticationTokenForUserβ a camelCase function name from a typical auth service- Input string 2
HTTP response handlerβ a space-separated natural-language phrase with a leading acronym
Step-by-step walkthrough
- Paste
getAuthenticationTokenForUserinto the input textarea. The tool auto-detects the source as camelCase by observing the internal uppercase transitions. - The tokeniser splits the string on each camelCase boundary, yielding
[get, authentication, token, for, user]. All tokens are lowercased. - Click the snake_case output chip β the output pane shows
get_authentication_token_for_user. - Click SCREAMING_SNAKE_CASE β the output pane shows
GET_AUTHENTICATION_TOKEN_FOR_USER. - Click the Copy button next to the desired output. The converted identifier is now on your clipboard, ready to paste directly into your code editor.
- Clear the input and paste
HTTP response handler. Select snake_case β the output showshttp_response_handler. TheHTTPacronym is treated as one token and lowercased as a unit. - Select camelCase for the same input β the output is
httpResponseHandler, withhttpin full lowercase as the leading word. - At any time, click the Try Example button to reload the pre-filled realistic payload and reset the demo.
Expected outputs
| Input | Target Format | Output |
|---|---|---|
getAuthenticationTokenForUser | camelCase | getAuthenticationTokenForUser |
| PascalCase | GetAuthenticationTokenForUser | |
| snake_case | get_authentication_token_for_user | |
| kebab-case | get-authentication-token-for-user | |
| SCREAMING_SNAKE_CASE | GET_AUTHENTICATION_TOKEN_FOR_USER | |
| Title Case | Get Authentication Token For User | |
HTTP response handler | snake_case | http_response_handler |
| camelCase | httpResponseHandler | |
| kebab-case | http-response-handler | |
| PascalCase | HttpResponseHandler |