How to convert text between cases: UPPERCASE, camelCase, snake_case, and the rest
You have text in one case and need it in another: a heading typed in all caps, a list of column names that must become camelCase, a constant that should be kebab-case in a URL. Retyping is slow and editing by hand invites typos. The Case Converter & Slugify tool converts between all the common cases in your browser, live as you type, and nothing you paste leaves the page.
The cases at a glance
The same phrase, rendered in each case:
| Case | Example |
|---|---|
| UPPERCASE | THE QUICK BROWN FOX |
| lowercase | the quick brown fox |
| Title Case | The Quick Brown Fox |
| Sentence case | The quick brown fox |
| camelCase | theQuickBrownFox |
| PascalCase | TheQuickBrownFox |
| snake_case | the_quick_brown_fox |
| kebab-case | the-quick-brown-fox |
| CONSTANT_CASE | THE_QUICK_BROWN_FOX |
What each one is for
The first four are prose cases. UPPERCASE and lowercase change letters without touching word boundaries, so they suit headings, labels, and cleanup of shouty input. Title Case capitalizes each word and belongs in headlines and titles. Sentence case capitalizes only the first word and is the default for body text and most UI copy.
The rest are identifier cases. They exist because code and URLs cannot contain spaces, so the words of a name must be joined some other way. camelCase and PascalCase mark word boundaries with capital letters; snake_case, kebab-case, and CONSTANT_CASE mark them with a separator character. Which one you reach for depends on the language and the context, and that choice has its own conventions; camelCase, snake_case, kebab-case, PascalCase: which goes where covers them. This post is about the mechanical step of getting from one to another.
How conversion actually works
Every reliable case conversion is a two step process: split the input into words, then rejoin them in the target style. The splitting step is the hard part. A converter has to recognize word boundaries wherever they hide: spaces, underscores, hyphens, and the lowercase to uppercase transitions inside theQuickBrownFox. Once the input is a clean list of words, producing any output case is trivial: lowercase everything and join with underscores for snake_case, capitalize each word and join with nothing for PascalCase, and so on.
This is why naive approaches fail. Calling .toUpperCase() on userId gives you USERID, not USER_ID; the word boundary that the capital I was carrying is gone, and no amount of downstream processing gets it back. The same applies in reverse: lowercasing parseHTML produces parsehtml, one unreadable blob. Convert boundaries first, letters second.
Gotchas worth knowing
- Acronyms. Should
parseURLbecomeparse_urlorparse_u_r_l? Most converters treat a run of capitals as one word, soURLstays together, but round trips can still mangle it:parse_urlback to camelCase givesparseUrl, notparseURL. Check acronyms by eye after converting. - Numbers. Is
user2fatwo words or three? Digits do not carry case, so converters have to guess whether a number starts a new word. Results vary; inspect anything with digits in it. - Existing separators. Input that already mixes styles, like
user_firstName, should split on both the underscore and the capital. A good converter handles this; a regex you wrote in thirty seconds usually does not. - Non latin letters. Case is a property of alphabets like Latin, Greek, and Cyrillic. Chinese, Japanese, Arabic, and many other scripts have no case at all, and some letters change length when cased (the German ß uppercases to SS). Locale matters too: Turkish famously maps
itoİ, notI. - Title Case is a style choice. The simple rule capitalizes every word. AP and Chicago style leave short words like "of", "the", and "a" lowercase unless they start the title. A converter gives you the simple version; apply house style yourself if you have one.
If the case change you need is for a URL, that is really slugification, which also strips punctuation and normalizes accents; turn a title into a URL slug walks through it, and the same Case Converter & Slugify tool handles both jobs.