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.
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-casefor URLs orsnake_casefor 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 likeuserfirstname. - Preserve acronyms and numbers: decide how to treat
API,ID,OAuth2, and version numbers. Some teams keepapiClientwhile others requireAPIClient; some keepoauth2Tokenwhile others wantoauth_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 Nameanduser-namecan 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
camelCasekeys (firstName), while Python or Ruby backends prefersnake_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 useCONSTANT_CASE(MAX_RETRY_COUNT,DATABASE_URL). Match the existing schema instead of inventing a new style per migration. - CSS, URLs, and branches: use
kebab-casefor 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
PascalCasefor 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