How to Convert Text Case: camelCase, snake_case, Title Case and More
Quick summary
Learn 12 text case styles, when to use camelCase, PascalCase, snake_case, kebab-case and Title Case, and how programming conventions differ by language.
Text case conversion changes the capitalization and word-separation style of a string — for example turning user first name into userFirstName (camelCase) or user_first_name (snake_case). Different programming languages and writing contexts expect different conventions, and using the wrong one breaks code or looks unprofessional. The NeatForge Text Case Converter shows all 12 variants at once in your browser.
Why Case Matters in Code and Writing
In code, case is often semantic: UserName and userName are two different identifiers in many languages, and my-class is a valid CSS class while my class is not. In writing, Title Case signals a headline, Sentence case signals body text, and ALL CAPS signals emphasis or urgency.
Getting case right matters because:
- Compilers and linters enforce naming conventions.
- APIs and databases expect specific identifier formats.
- Headlines and titles follow publishing style guides.
The 12 Case Styles Explained
- UPPERCASE — every letter capitalized (
HELLO WORLD). - lowercase — every letter lowercased (
hello world). - Title Case — capitalizes major words, keeps small words like “a”, “the”, “in” lowercase unless first or last (
Hello World and Goodbye). - Sentence case — capitalizes only the first letter of the sentence (
Hello world and goodbye). - Capitalize Each Word — first letter of every word uppercased (
Hello World And Goodbye). - camelCase — first word lowercase, subsequent words capitalized, no separators (
helloWorld). - PascalCase — every word capitalized, no separators (
HelloWorld). - snake_case — words lowercase, separated by underscores (
hello_world). - kebab-case — words lowercase, separated by hyphens (
hello-world). - CONSTANT_CASE — words uppercase, separated by underscores (
HELLO_WORLD). - aLtErNaTiNg — alternating case letter by letter (
hElLo WoRlD). - InVeRsE — swaps the case of every letter (
HELLO WORLD→hello world).
For programming cases, all non-alphanumeric characters (spaces, dashes, punctuation) are treated as word separators and removed.
When to Use Each Case
Programming conventions vary by language:
- JavaScript / TypeScript —
camelCasefor variables and functions,PascalCasefor classes and React components. - Python —
snake_casefor variables and functions,PascalCasefor classes. - Rust and Go —
PascalCasefor exported/public items,snake_casefor private (Rust) orcamelCase(Go) for locals. - CSS and HTML —
kebab-casefor class names and custom properties (--primary-color). - Constants —
CONSTANT_CASEin JavaScript, Python and many others (MAX_RETRY_COUNT). - Writing — Title Case for headlines and book titles, Sentence case for sentences and many blog post titles.
How to Convert Text Case
- Open the Text Case Converter.
- Type or paste your text into the input box.
- All 12 variants appear instantly in a grid below — no button to click.
- Click Copy next to the variant you need.
All conversion happens locally in your browser, so your text is never uploaded or stored.
FAQ
What is the difference between Title Case and Capitalize Each Word? Title Case keeps small words like “a”, “the”, “in” lowercase unless they are first or last. Capitalize Each Word uppercases the first letter of every word.
What is CONSTANT_CASE used for?
CONSTANT_CASE (uppercase with underscores) names constants in many languages, for example MAX_RETRY_COUNT in JavaScript or Python.
How does camelCase handle punctuation?
All non-alphanumeric characters are treated as word separators and removed, so hello world! becomes helloWorld.
→ Open the free Text Case Converter