How to Convert Text Case: camelCase, snake_case, Title Case and More

Published on May 15, 2026 • Updated on September 8, 2026

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.

Topic: Image tools

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 — camelCase for variables and functions, PascalCase for classes and React components.
  • Python — snake_case for variables and functions, PascalCase for classes.
  • Rust and Go — PascalCase for exported/public items, snake_case for private (Rust) or camelCase (Go) for locals.
  • CSS and HTML — kebab-case for class names and custom properties (--primary-color).
  • Constants — CONSTANT_CASE in 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

  1. Open the Text Case Converter.
  2. Type or paste your text into the input box.
  3. All 12 variants appear instantly in a grid below — no button to click.
  4. Click Copy next to the variant you need.

All conversion happens locally in your browser, so your text is never uploaded or stored.

Choosing a convention for a project

A converter can produce a syntactically valid name, but the repository or platform convention should decide which style you keep. Check nearby variables, API documentation, database schemas, and lint rules before renaming a public field. Consistency is usually more valuable than choosing a style that looks fashionable.

For URLs and file paths, prefer stable lowercase slugs with hyphens. For identifiers, preserve acronyms deliberately: an API client may use apiClient, APIClient, or api_client depending on its language and existing style. Also check whether the conversion removes punctuation that separates meaningful words in a product name or technical acronym.

Bulk renaming and regex workflows

A case converter handles one string at a time, but real projects often need hundreds of renames. Use bulk workflows once you know the target style.

  • File and asset batches: export a list of file names, convert the whole column to kebab-case for URLs or snake_case for data files, then rename with a script instead of clicking one by one. Keep extensions lowercase and avoid spaces, which break links and shell commands.
  • Regex cleanup first: normalize separators before converting. A pattern like [\s._-]+ catches spaces, dots, underscores, and hyphens as word boundaries, while ([a-z0-9])([A-Z]) finds camelCase boundaries. Splitting on those boundaries first prevents merged words like userfirstname.
  • Preserve acronyms and numbers: decide how to treat API, ID, OAuth2, and version numbers. Some teams keep apiClient while others require APIClient; some keep oauth2Token while others want oauth_2_token. Document the rule so automated renames stay consistent.
  • Review the diff: run the rename as a preview or version-controlled change. Check for collisions (User Name and user-name can map to the same slug), reserved words, and broken imports before committing.

For one-off headlines or variable names the visual grid is fastest; for migrations, pair the converter output with a script and a code review.

Developer scenarios: APIs, databases, and branches

Different layers of a stack often expect different cases at the same time.

  • APIs and JSON: JavaScript clients usually send camelCase keys (firstName), while Python or Ruby backends prefer snake_case (first_name). Convert at the boundary layer and test serialization round-trips so no field is silently dropped.
  • Databases and environment variables: tables and columns commonly use snake_case, constants and env vars use CONSTANT_CASE (MAX_RETRY_COUNT, DATABASE_URL). Match the existing schema instead of inventing a new style per migration.
  • CSS, URLs, and branches: use kebab-case for class names, slugs, and Git branches (feature/user-profile-page). Lowercase hyphenated names survive URL encoding, file systems, and command lines with the fewest surprises.
  • Components and types: use PascalCase for classes, types, and UI components (UserProfile, PaymentForm). This visual signal separates blueprints from instances (userProfile) in code review.

When in doubt, mirror the neighboring code. A converter guarantees valid formatting, but only the project convention guarantees the name will look native to future maintainers.

FAQ

→ Open the free Text Case Converter

Advertisement

Frequently asked questions

What is the difference between camelCase and PascalCase?

camelCase starts with a lowercase word and capitalizes later words, such as userName. PascalCase capitalizes every word, such as UserName, and is commonly used for classes and components.

When should I use snake_case?

Use snake_case when the language or project convention expects lowercase words separated by underscores. It is common for Python variables and functions, database fields, and some configuration files.

When should I use kebab-case?

Use kebab-case for URL slugs, CSS classes, HTML attributes, and file names when the surrounding tool expects hyphen-separated lowercase words.

Does converting text case change punctuation?

The programming-oriented conversions treat spaces, punctuation, and dashes as word separators, then remove them or replace them with the target separator. Preserve punctuation manually when it carries meaning.

Is Title Case the same as Capitalize Each Word?

Not always. Title Case may keep short articles and prepositions lowercase according to a style guide, while Capitalize Each Word uppercases the first letter of every word.

Explore this topic

Image tools

Read more guides in this cluster and move between related tools faster.

View topic guides

Useful tools

Related Guides