Skip to main content
Best Answer Hub logo Best Answer Hub.
Back to Playbooks
Best Answer Hub Playbooks · Writing & Code
Same words, eight looks

Which Text Case to Use, and When

Uppercase, title case, camelCase, snake_case: the same words can be written eight ways, and each has a job. Here is which case fits a title, which fits code, which fits a URL, and why converting case is trickier than it looks.

Writingtitle & sentence
Codecamel, snake, kebab
One clickeight formats
8
case formats in one click
Best Answer Hub
0
text uploaded to any server
Best Answer Hub
4+
letters: when AP capitalizes a preposition
AP style
ß→SS
one letter that grows when uppercased
Unicode

The same phrase can be written in at least eight different cases, and choosing the right one is not just style: it is what makes a heading read cleanly, a variable name compile, and a URL rank. The Best Answer Hub Case Converter switches text between all eight in one click, entirely in your browser, with nothing uploaded, so you can match the case to the job without retyping a thing.

Most people know upper and lower case. The interesting choices are the ones in between: title versus sentence case for writing, and the family of programming cases (camelCase, snake_case, kebab-case) for code and the web. This guide covers when to use each, and the surprising ways case conversion goes wrong.

One phrase, eight ways

The eight text cases at a glance

Here is the same input written in every case the tool produces. The four on the left are for reading; the four on the right are for code and the web. The infographic below shows them side by side, and the table names where each one belongs.

The same phrase in eight cases
input: hello world example
UPPERCASE
HELLO WORLD EXAMPLE
camelCase
helloWorldExample
lowercase
hello world example
PascalCase
HelloWorldExample
Title Case
Hello World Example
snake_case
hello_world_example
Sentence case
Hello world example
kebab-case
hello-world-example

Case names per MDN glossary (camel case, snake case, kebab case). The Best Answer Hub Case Converter outputs all eight.

CaseExampleWhere it belongs
UPPERCASEHELLO WORLDAcronyms, short emphasis, not body text
lowercasehello worldCasual text, tags, some brand styling
Title CaseHello WorldFormal titles, headings, product names
Sentence caseHello worldHeadlines, UI labels, subject lines
camelCasehelloWorldVariables and functions in JavaScript
PascalCaseHelloWorldClass names and components
snake_casehello_worldPython code, database columns
kebab-casehello-worldURLs, CSS classes, HTML attributes
The writing choice

Title case or sentence case: which should you use?

Use title case for formal titles and sentence case for almost everything else. Title case capitalizes the major words, like "The Quick Brown Fox," and suits book and film titles, product names, and formal headings. Sentence case capitalizes only the first word and any proper nouns, like "The quick brown fox," and it has become the default for headlines and interface text because it reads more naturally and is harder to get wrong. Government and product style guides now say so outright: the GOV.UK Design System instructs teams to "write all headings in sentence case" (GOV.UK).

Title case itself is not one rule but several, which is why two tools can capitalize the same title differently. The split is over small words. The Chicago Manual of Style lowercases all prepositions no matter how long, so it keeps "with" lowercase (Chicago), while AP style capitalizes prepositions and conjunctions once they reach four letters, so it writes "With." One rule holds across every guide: the first and last word of a title are always capitalized, whatever they are.

The rule people get wrong

Short verbs are always capitalized in a title. Words like "Is," "Are," "Be," and "It" look small, so people lowercase them, but only articles, short prepositions, and coordinating conjunctions drop to lowercase. "What It Is" is correct; "What it is" is not, in title case.

The code choice

Which case should you use for code?

In programming, case is not decoration, it is convention, and each language has one. Python official style, PEP 8, says function and variable names "should be lowercase, with words separated by underscores," which is snake_case, while class names "should normally use the CapWords convention," which is PascalCase (PEP 8). JavaScript goes the other way for variables: MDN guidance is to "use camel case, starting with a lowercase character," and PascalCase for classes (MDN). Constants are conventionally all caps with underscores. Following the convention is what makes code readable to the next person, and in some linters, valid at all.

ContextConventionExample
Python functions and variablessnake_caseget_user_profile
Python and other class namesPascalCaseUserProfile
JavaScript variables and functionscamelCasegetUserProfile
ConstantsUPPER with underscoresMAX_RETRIES
CSS classes and URLskebab-caseget-user-profile
A small but real SEO point

Is snake_case or kebab-case better for URLs?

For URLs and CSS, kebab-case wins, and for a concrete reason. Search engines and the web platform treat a hyphen as a word separator but an underscore as a joiner, so get-user-profile reads as three words while get_user_profile can read as one. Google has long advised using hyphens rather than underscores in URLs for exactly this reason, and MDN documents kebab-case as the convention for CSS custom properties and class names (MDN). Save snake_case for Python and database work, where the underscore is at home.

Case is a signal, not decoration. The right one tells a reader you are formal, or tells a compiler you meant a class, or tells Google where the words break.
Where it goes wrong

Why is converting case trickier than it looks?

Because letters do not always map one-to-one. The clearest example is the German eszett: the lowercase sharp s uppercases to "SS," two letters, so uppercasing a word can actually change its length (Unicode). Case can also be language-dependent. In Turkish, a lowercase "i" uppercases to a dotted capital and an uppercase "I" lowercases to a dotless one, so a naive English-style conversion is simply wrong for Turkish text. This is why JavaScript offers locale-aware methods, toLocaleUpperCase and toLocaleLowerCase, alongside the plain ones, and MDN notes the results differ "for some locales, such as Turkish" (MDN).

Two more traps are worth knowing. There is no single correct title case, because the rules are style-specific and no programming language ships a built-in toTitleCase, so every converter has to pick a convention. And brand names with deliberate casing, like iPhone, macOS, or eBay, will be flattened by any automatic tool, so restore those by hand after converting. A last, softer point: long passages set in all capitals are harder to read for most people, which W3C accessibility material advises against for body text (W3C WAI), so keep uppercase for short emphasis, not paragraphs.

The quiet benefit

Is it private to convert text online?

It is when the tool runs on your device, and that is worth checking for anything sensitive. Converting case is trivial, but the text itself may not be: an unpublished headline, a client name, a snippet of code. Many online converters send whatever you paste to a server, which hands that text to a third party for no good reason. The safer habit mirrors what regulators advise about data you do not need to share: the FTC tells organizations not to collect sensitive information they have no need for (FTC).

The Best Answer Hub Case Converter runs entirely in your browser using local JavaScript string methods, so your text never leaves the page. There is no upload, no account, and nothing stored. It is a small tool, but the principle holds: if the work can happen on your own machine, there is no reason to send the words anywhere.

Switch case in one click

Convert text between all eight cases, free

Paste your text, click a format, and copy the result. Title, sentence, camelCase, snake_case, and more, all in your browser with nothing uploaded.

Open the Case Converter
Good questions

Common questions about text case

What is the Best Answer Hub Case Converter?
The Best Answer Hub Case Converter is a free, browser-based tool that transforms text between eight formats: uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case, and kebab-case. Paste your text, click a format, and copy the result. Everything runs locally, with no signup and nothing uploaded to a server.
What is the difference between title case and sentence case?
Title case capitalizes the major words in a phrase, like The Quick Brown Fox. Sentence case capitalizes only the first word and any proper nouns, like The quick brown fox. Title case suits formal titles and product names, while sentence case suits headlines, interface labels, and email subject lines.
When should I use title case versus sentence case?
Use title case for book, film, and formal headings, and sentence case for almost everything digital. Most modern style guides, including the GOV.UK Design System, now default to sentence case for headings because it reads more naturally and is harder to get wrong. Neither has any search ranking advantage.
How do AP and Chicago title case rules differ?
Mainly over prepositions. AP style capitalizes prepositions and conjunctions of four or more letters, so it writes With and From. The Chicago Manual of Style keeps all prepositions lowercase regardless of length, so it writes with. Both always capitalize the first and last word of a title, whatever the word is.
Which small words stay lowercase in a title?
The minor words usually left lowercase are articles like a, an, and the, coordinating conjunctions like and, but, and or, and short prepositions like of, to, and in. The exception is universal: the first and last word of a title are always capitalized, even when they are one of these small words.
Are short verbs like is and are capitalized in a title?
Yes, always. Verbs are capitalized in title case no matter how short they are, so Is, Are, Be, and It are all capitalized. Only articles, short prepositions, and coordinating conjunctions drop to lowercase. This is one of the most common title case mistakes, and every major style guide agrees on it.
What is the difference between camelCase, PascalCase, snake_case, and kebab-case?
camelCase joins words with the first lowercase and each later word capitalized, like getUserProfile. PascalCase capitalizes every word, like GetUserProfile. snake_case joins words with underscores in lowercase, like get_user_profile. kebab-case joins them with hyphens, like get-user-profile. Each has its own home in code and the web.
Which case should I use for code in Python or JavaScript?
Follow the language convention. Python PEP 8 uses snake_case for functions and variables and CapWords, or PascalCase, for classes. JavaScript uses camelCase for variables and functions, and PascalCase for classes. Constants are conventionally uppercase with underscores. Matching the convention keeps code readable and, with some linters, valid.
Is snake_case or kebab-case better for URLs?
kebab-case, with hyphens, is better for URLs and CSS. Search engines treat a hyphen as a word separator and an underscore as a joiner, so get-user-profile reads as three words while get_user_profile can read as one. Google advises hyphens in URLs. Keep snake_case for Python code and database columns.
Why do title case converters give different results?
Because there is no single title case standard. AP, Chicago, APA, and MLA each define different rules for prepositions and conjunctions, so a tool that does not say which style it follows will vary. The Best Answer Hub Case Converter applies a widely used convention, and for academic work you should check the required style guide.
Why can uppercasing change the length of my text?
Because some characters do not map one-to-one. The German lowercase eszett, written as a sharp s, uppercases to two letters, SS, so a word can get longer when you uppercase it. Unicode documents these exceptional mappings. It is a small thing, but it can break assumptions in code that expects uppercase and lowercase to be the same length.
Does converting case handle other languages correctly?
It can, but only with locale-aware conversion. In Turkish, a lowercase i uppercases to a dotted capital and an uppercase I lowercases to a dotless one, so an English-style conversion is wrong. JavaScript provides toLocaleUpperCase and toLocaleLowerCase for this, and MDN notes the result differs for locales such as Turkish.
Should brand names like iPhone keep their casing?
Yes. Names with deliberate casing, like iPhone, macOS, eBay, and YouTube, should keep their official form even inside a title. Automatic converters flatten them into Iphone or Macos, so after converting a heading, restore any brand names by hand. The structural case conversion is automatic, but brand exceptions are manual.
Is it private to convert text in an online tool?
Only if it runs on your device. Many online converters upload your text to a server, which exposes anything sensitive like an unpublished headline or code. The Best Answer Hub Case Converter processes everything in your browser with local JavaScript, so nothing is uploaded, stored, or seen by anyone else.
Is the Best Answer Hub Case Converter free?
Yes, completely free with no signup, no limits, and no ads. It runs on client-side JavaScript in your browser, so there are no server costs and no account to create. You can convert as much text as you like between all eight cases, and copy each result with one click.
People also read

Keep going

Sources

Jump into the tools: Case Converter, Word Counter, and the Career Toolkit.

Built & maintained by Shahbaz Ali Malik Last updated: