Help & Feedback

A human will get back to you.

All Posts
Tools

A Quick Guide To Text Case Conventions: Title, Sentence, camelCase, snake_case And kebab-case

4 min read

Cover image for A Quick Guide To Text Case Conventions

Case looks like decoration until it breaks something. A headline style that contradicts your brand guide, an environment variable typed in the wrong convention, a CSS class that doesn't match the stylesheet: small text, real consequences.

Each convention exists because some system or reader depends on it. Knowing which one you're supposed to be in is most of the battle; converting between them is the easy part.

Title Case And Sentence Case Are Editorial Choices

Title case capitalizes the major words: "How to Build a Better Onboarding Flow." Sentence case capitalizes only the first word and proper nouns: "How to build a better onboarding flow."

Neither is correct in general; each is correct somewhere. Pick per surface and stay consistent. A blog that mixes "10 Ways to Improve Retention" with "10 ways to improve retention" looks unedited even when the writing is fine. If your brand has a style guide, it wins. If it doesn't, choose one for headings today and write it down.

Title case has its own internal rules, which is where people burn time: short words like "a," "and," "to" and "the" usually stay lowercase unless they open the title. Different style guides disagree on the details, so consistency inside one document matters more than winning the argument.

Uppercase Is A Signal, Not A Style

ALL CAPS reads as emphasis or shouting depending on context, which is why body text almost never wants it. It does have legitimate jobs: acronyms, short labels, legal boilerplate and constants in code.

The conversion trap runs both ways. Text that was typed with Caps Lock on needs to come down to something readable. Text going into a system that expects constants, like an environment variable, needs to go up. Keep a human-readable version of anything you uppercase, because "REFUND POLICY EFFECTIVE MARCH 1" is much harder to edit later than the sentence it came from.

Code Cases Follow The Language, Not Your Taste

Programming communities settled their conventions long ago, and matching them is part of writing code that looks like it belongs.

camelCase joins words without spaces and capitalizes each word after the first: customerEmailAddress. It's the default for variables and functions in JavaScript and Java. PascalCase capitalizes the first word too, and shows up for class names and components: CustomerEmailForm.

snake_case separates words with underscores, all lowercase: customer_email_address. Python and Ruby use it, and it shows up often in database columns and configuration files. Its shouty sibling, CONSTANT_CASE or SCREAMING_SNAKE_CASE, marks values that shouldn't change: MAX_RETRY_COUNT.

kebab-case uses hyphens: customer-email-address. URLs, CSS classes and file names often favor it, partly because hyphens are word separators that most systems tolerate and search engines read as spaces.

The rule of thumb: use what the surrounding code already uses. A lone camelCase variable in a snake_case file makes every future reader pause.

Converting By Hand Is Where Typos Breed

Retyping text to change its case invites two failure modes: you mistype a character, or you "fix" something that was intentional, like a brand name with unusual capitalization. Pasting into a converter avoids retyping, but conversion still changes capitalization mechanically, so proofread the result.

Watch for what conversion can't know. Lowercasing loses deliberate capitalization, so GitHub becomes github and an acronym like API becomes api. And this converter does not split word boundaries inside existing code-style text: customerEmailAddress fed into a lowercase or snake_case conversion comes out as one unbroken word like customeremailaddress, because the capital letters were the only word boundaries. Convert from normal, space-separated text when you can: customer email address converts cleanly into camelCase, snake_case or kebab-case.

The Case Converter on DigitalDecided handles the common ones: title case, sentence case, SCREAMING, plus the code cases including camelCase, snake_case and kebab-case. Type or paste once, pick the version you need and copy it out. Conversion runs in your browser.

Convert, paste, and then do the one check automation can't do for you: make sure the capitalization that was deliberate, the iPhones and GitHubs of your text, survived the trip.

Share this piece