How to Convert Text Between Cases (camelCase, snake_case, and More)

Convert text to UPPER, lower, Title, camelCase, PascalCase, snake_case, and kebab-case for code, CSS, and copy — with a free converter.

By Generatr Team

Case is not decoration. In code, userId, user_id, and user-id mean different conventions to linters, APIs, CSS, and teammates. In writing, Title Case, sentence case, and ALL CAPS change how headings and brand names read on a page.

This guide covers everyday prose cases (UPPER, lower, Title, Sentence), programming styles (camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE), when to use each, and a clean conversion workflow. Convert live with the free text case converter — paste once, copy any format, and skip hand-editing every token.

You will leave knowing which case fits variables, classes, env vars, and titles — and how to switch between them without mangling acronyms or numbers.

Free tool

Use the Text Case Converter now

Open the interactive text case converter in your browser — free, instant, no signup.

Open Text Case Converter

How Do UPPER, lower, Title, and Sentence Case Differ?

Prose cases change readability and tone more than machine identity. They still matter in CMS fields, email subjects, and design comps where “almost right” titles look sloppy.

The four everyday forms

  • UPPERCASE — every letter capital. Useful for short labels, acronyms, and shouting. Hard to scan in long paragraphs.
  • lowercase — every letter small. Common in informal UI chrome, tags, and some brand styles; rare for full sentences in formal docs.
  • Title Case — major words capitalized. Styles differ on small words (“a,” “the,” “of”). Good for article titles and nav labels when you follow one style guide.
  • Sentence case — only the first letter of the sentence (plus proper nouns) is capital. Default for body copy and many modern product UIs.

Title Case is not the same as Capitalizing Every Word Blindly. Style guides (AP, Chicago, house rules) disagree on short prepositions. If your team has a guide, match it; if not, pick sentence case for product UI and stick to it.

Paste a headline into the text case converter and compare Title vs Sentence side by side before you ship a marketing page. For character limits on titles and meta fields, pair this with the string length checker and the string length guide.

When Should You Use camelCase vs PascalCase?

camelCase starts with a lowercase letter and capitalizes later word boundaries: getUserById, isActive. PascalCase (sometimes called UpperCamelCase) capitalizes the first letter too: GetUserById, UserProfile.

Typical language conventions

  • JavaScript/TypeScript — variables and functions in camelCase; classes, React components, and types often in PascalCase
  • C# / Java / many OOP stacks — types and public methods often PascalCase; fields/locals may differ by house style
  • JSON APIs — camelCase property names are common on the web; some backends prefer snake_case instead

Conversion is not only lowercasing the first letter. You split on spaces, underscores, hyphens, or existing capital boundaries, then rejoin. A source like user_profile_id becomes userProfileId in camelCase and UserProfileId in PascalCase.

Acronyms and numbers

Decide how you treat HTML, ID, and URL. Some teams keep parseHTML; others prefer parseHtml. Numbers stay attached: sha256Hash, not a random split mid-digit. The converter should preserve digits and give you a consistent base you can nudge for acronym policy.

Generate both forms from one phrase in the free camelCase and PascalCase converter, then paste into your editor. When you need pattern validation on renamed symbols, the regex tester helps you search-and-replace carefully — see also the regex testing guide.

How Do snake_case and kebab-case Work?

snake_case joins words with underscores and is usually all lowercase: created_at, max_retry_count. SCREAMING_SNAKE_CASE or CONSTANT_CASE uses uppercase: MAX_RETRY_COUNT, classic for environment variables and some constants.

kebab-case (hyphen-case) joins with hyphens: created-at, max-retry-count. CSS class names, HTML data attributes, URL path segments, and many design-token names prefer kebab-case because spaces and underscores are awkward in URLs and selectors.

Where each shines

  • snake_case — Python identifiers, many SQL columns, Ruby style, some JSON backends
  • CONSTANT_CASE — env vars (DATABASE_URL), build flags, true constants in some codebases
  • kebab-case — CSS, BEM-ish class names, npm package names, slugs in paths

Hyphens are operators in most programming languages, so kebab-case is a poor choice for JS variable names. Underscores are legal identifiers in most languages, so snake_case travels better inside code.

Convert a design token list to kebab-case for CSS and snake_case for a Python config from the same source string using the text case converter. For dummy labels at a target word count while you test layouts, the lorem ipsum generator and lorem ipsum guide fill space without inventing final copy.

Which Case Should You Pick for Code and Content?

Match the ecosystem first, then your team’s style guide. Fighting the framework costs more than a personal preference.

Quick decision map

  • React component file / type name — PascalCase (UserCard.tsx)
  • JS function or variable — camelCase
  • Python function or variable — snake_case
  • Env var — CONSTANT_CASE
  • CSS class / URL slug — kebab-case
  • Marketing H1 — Title Case or sentence case per brand guide
  • Body paragraph — sentence case
  • Database column (many teams) — snake_case

When an API returns snake_case and your frontend uses camelCase, convert at the boundary (serializer or a small mapper) instead of mixing styles inside one file. Your future self will thank you when grepping for a field name.

Reading metrics for long-form content use different tools than case: check the word count checker and word count guide when length and readability matter more than naming.

What Edge Cases Break Naive Case Conversion?

Naive “replace spaces and hope” scripts fail on real strings. Know the traps before you bulk-rename a codebase.

  • Already mixed inputget_userID has both underscores and capitals; split rules must handle both
  • AcronymsparseJSON vs parseJson; pick a policy
  • Leading numbers2faEnabled is a valid idea but illegal as some language identifiers if it starts with a digit after conversion mistakes
  • Special characters — apostrophes, punctuation, and emoji should usually be stripped or spaced before casing for code identifiers
  • Unicode letters — case maps differ by locale; Turkish i/İ is the classic gotcha
  • Hidden characters — zero-width spaces from chat apps break “simple” renames; clean text first with an invisible character checker when paste looks normal but tools misbehave

For identifier work, convert from a clean human phrase (“max retry count”) rather than from a half-converted mess. For content, run spellcheck after Title Case so you do not capitalize random mid-sentence words forever.

If invisible paste junk is the real bug, read the invisible character guide next — case conversion cannot fix bytes you cannot see.

How Do You Convert Cases Efficiently in Daily Work?

A repeatable workflow beats one-off mental math when you rename twenty fields or reformat a nav list.

  1. Copy the source string from design, ticket, or API docs.
  2. Paste into the text case converter.
  3. Scan word/character counts if you care about UI width or commit message length.
  4. Copy camelCase for frontend, snake_case for backend, kebab-case for CSS/slug as needed.
  5. Apply through your editor’s multi-cursor or a careful project-wide replace.
  6. Run tests/linters; case-only renames still break stringly-typed maps and CSS modules if you miss a call site.

For one-off titles, conversion in the tool is enough. For hundreds of symbols, generate the canonical form once, then use IDE rename refactoring so references update together. The converter is the source of truth for the spelling of the identifier, not a substitute for semantic rename tools.

Building handles for social or product accounts is a different naming job — see the username generator guide and username generator when the output must be unique online, not merely well-cased.

How Do You Use Generatr’s Text Case Converter?

Paste once, read every format, copy the one your stack expects.

  1. Open the free text case converter.
  2. Paste a phrase, heading, or identifier (spaces, hyphens, or underscores all fine as input).
  3. Review UPPER, lower, Title, Sentence, camelCase, PascalCase, snake_case, kebab-case, and related forms.
  4. Check word and character counts if you are sizing a UI string.
  5. Copy the format you need with one click.
  6. Paste into code, CSS, CMS, or docs.
  7. Repeat for the next string, or batch by converting a short list one line at a time.

Related text tools: string length checker, word count checker, lorem ipsum generator, and regex tester for search patterns after renames.

Step-by-Step Instructions

  1. 1Open the free text case converter on Generatr.
  2. 2Paste a phrase, variable name, or heading you want to reformat.
  3. 3Review prose cases (UPPER, lower, Title, Sentence) for content use.
  4. 4Review code cases (camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE).
  5. 5Copy the format that matches your language, CSS, or style guide.
  6. 6Apply the result in your editor; use IDE rename for multi-file symbols.
  7. 7Strip hidden characters first if paste behaves oddly.
  8. 8Recheck linters and tests after bulk renames.

Frequently Asked Questions

What is the difference between camelCase and PascalCase?+

camelCase starts with a lowercase letter (getUserName). PascalCase capitalizes every word including the first (GetUserName). Many JS codebases use camelCase for values and PascalCase for types and components.

When should I use snake_case vs kebab-case?+

Use snake_case for many backend identifiers, Python names, and SQL-style columns. Use kebab-case for CSS classes, URL slugs, and package names. Avoid kebab-case for variables in languages where hyphens mean subtraction.

Is Title Case the same as capitalizing every word?+

Not always. Style guides often leave short words lowercase in titles. Follow your brand or publication guide, or prefer sentence case for product UI if you want fewer debates.

Can I convert multiple lines at once?+

Paste a single string or work line by line depending on the tool UI. For large renames, convert the canonical form once, then use your IDE’s rename or a scripted replace so every reference stays in sync.

Why did my conversion break an acronym?+

Converters split on capital letters and may turn HTMLParser into html parser pieces that rejoin as HtmlParser or html_parser. Decide a team rule for acronyms and adjust the final token if needed.

Is the text case converter free?+

Yes. Convert between 10+ case styles in the browser, copy results, and use word/character counts without an account.

Ready to try it yourself?

Use the free Text Case Converter — no download, no account.

Launch Text Case Converter