utilyfe

Case Converter

Fix a shouty headline, tidy a list of titles, or turn a phrase into a variable name.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to use the Case Converter

  1. 1Paste or type your text into the box.
  2. 2Pick a case. The result shows up underneath and changes the moment you pick a different one.
  3. 3Press Copy to put the result on your clipboard. The text in the top box stays exactly as you wrote it.

Which case to use

Case Looks like Where you’ll usually see it
Sentence case The quick brown fox Body text, buttons and form labels; headlines at many British papers
Title Case The Quick Brown Fox Titles of books, films and articles; most American headlines
UPPER CASE THE QUICK BROWN FOX Short labels and warnings. A whole paragraph of it reads like shouting.
lower case the quick brown fox Tags, usernames, brands that style themselves that way
Capitalized Case The Quick Brown Fox Like Title Case, but small words get a capital too
camelCase theQuickBrownFox Variables and functions in JavaScript, Java and Swift
PascalCase TheQuickBrownFox Class names, and components in React
snake_case the_quick_brown_fox Python variables and functions, database columns
kebab-case the-quick-brown-fox Web addresses, CSS class names, file names
CONSTANT_CASE THE_QUICK_BROWN_FOX Constants and environment variables

How our Title Case decides

Title case sounds simple until you reach words like “of”, “with” and “vs.” Style guides don’t agree on them, so this is exactly what the converter does:

  • The first and last words always get a capital, and so does the first word after a colon or a dash.
  • Articles, short conjunctions and short prepositions stay lowercase: a, an, the, and, but, or, nor, for, so, yet, as, at, by, in, of, on, per, to, via, vs.
  • Everything else gets a capital, including short words like “is”, “it” and “be”. They’re verbs and pronouns, and every major style guide capitalizes those.
  • In a hyphenated word, each part is judged on its own: “long-term” becomes “Long-Term”, while “step-by-step” becomes “Step-by-Step”.
  • A word that already has a capital in the middle, like iPhone, eBay or NASA, is left alone.

A few examples of what comes out:

  • the lord of the rings: the return of the king → The Lord of the Rings: The Return of the King
  • what to do when your code won’t compile → What to Do When Your Code Won’t Compile
  • a guide to living with less → A Guide to Living With Less

The last one is where Chicago style differs. It lowercases prepositions of any length, so a Chicago editor would write “Living with Less”.

Sentence case can’t spot names

Sentence case lowercases everything and then capitalizes the start of each sentence. It has no way of knowing that “sarah” is a person or “paris” is a city, so this:

WE MET SARAH IN PARIS. IT RAINED.

comes out as “We met sarah in paris. It rained.” It does fix the word “I” on its own, so “i think i’m late” becomes “I think I’m late”. Give the result a quick read and put the capitals back on names and brands.

Turning phrases into names for code

For the code cases, the converter first works out where each word starts. Spaces, hyphens, underscores and dots all count as breaks, and so does a switch from a lowercase letter to a capital. A run of capitals is kept together as one word, which is how acronyms survive:

You type snake_case camelCase
Customer ID number customer_id_number customerIdNumber
getHTTPResponse get_http_response getHttpResponse
user-profile.settings user_profile_settings userProfileSettings

Capital letters aren’t always one letter

A handful of letters change length when you capitalize them. The German ß has no everyday capital form, so “straße” in UPPER CASE comes out as “STRASSE”. Converting that back to lower case gives “strasse”, not “straße”, so keep your original if the spelling matters.

Turkish is the other one to watch. The converter uses the standard mapping, where a lowercase i becomes a plain I. In Turkish it should become İ, with a dot, so check Turkish text by eye.

Questions

Why is "With" capitalized in my title but "of" isn't?
Our Title Case follows the rule AP and APA style share. Short articles, conjunctions and prepositions (a, and, of, to, in and so on) stay lowercase, and words of four letters or more get a capital. Chicago style also lowercases longer prepositions like "with" and "from", so if you write to Chicago rules, change those back by hand.
Can I convert a whole list of variable names at once?
Yes. Put one name or phrase on each line. The code cases (camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE) convert every line separately, so your line breaks survive.
What happens to apostrophes, numbers and symbols?
In the text cases they stay where they are. In the code cases, apostrophes are dropped, so "don't" becomes "dont"; digits are kept; and any other symbol is treated as a gap between two words.
Is my text sent anywhere?
No. The conversion runs as plain JavaScript on this page. Nothing is uploaded, logged or saved, and refreshing the page clears the box.
Does it work with accents and other alphabets?
Yes, for any alphabet that has capital letters, such as French, German, Spanish, Greek or Russian. Scripts without capitals, like Chinese, Arabic or Hindi, pass through unchanged.