Command Palette

Search for a command to run...

Text Case Converter: How to Change Text Case Online (10+ Formats)

Text Case Converter: How to Change Text Case Online (10+ Formats)

T
Toolz Team
|Jun 30, 2026|14 min read

The first time a senior engineer left a comment on my pull request that just said "naming," I had no idea what he meant. The code worked. The tests passed. What he was pointing at was a variable I'd written as user_name in a JavaScript file โ€” snake_case in a codebase that used camelCase everywhere else. It was a five-second fix, but it was the kind of thing that quietly signals whether you know the conventions of the language you're writing in.

Fifteen or so years and a WordPress plugin plus a Laravel/React SaaS later, case conversion is something I do dozens of times a day without thinking. Full-stack work means constantly crossing conventions: snake_case columns in the database, camelCase in the JavaScript, PascalCase for the React components, kebab-case in the CSS and the URLs, SCREAMING_SNAKE_CASE for the environment variables. Getting them wrong doesn't just look sloppy โ€” it trips linters, breaks builds, and occasionally produces bugs that are miserable to track down.

This guide covers every major case format, maps each one to the languages that expect it, and shows how to convert between them instantly with the free Case Converter on toolz.dev. Everything runs in your browser, so even if you're pasting proprietary identifiers, nothing leaves your machine.

TL;DR: Use the Case Converter to switch text between camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, Title Case, Sentence case, and dot.case. It auto-detects word boundaries from any input and converts multi-line lists line by line. Rule of thumb: camelCase for JS variables, PascalCase for classes and React components, snake_case for Python and SQL, kebab-case for CSS and URLs, SCREAMING_SNAKE_CASE for constants.


What Are the Main Text Case Formats?

Every case format is really two decisions: how words are capitalized, and what character (if any) separates them. Once you see it that way, the whole zoo becomes a small table. Here's each format with an example and where it lives.

camelCase

First word lowercase, every following word capitalized, no separators: firstName, getUserProfile, isActiveSubscription. This is the default for JavaScript and TypeScript variables, functions, methods, and object properties, and the same in Java and Swift. The name comes from the "humps" the capital letters make. It's compact and reads well at short-to-medium length.

PascalCase (UpperCamelCase)

Like camelCase but the first word is capitalized too: UserProfile, HttpRequestHandler, OrderService. It's used for classes, structs, and enums across C#, TypeScript, Java, Go (for exported identifiers), and Python (PEP 8 class names), and for React and Vue component names. The capitalized first letter is what lets you tell a type (UserProfile) from an instance (userProfile) at a glance.

snake_case

All lowercase, words joined by underscores: first_name, get_user_profile, created_at. It's the house style for Python and Ruby (per PEP 8 and the Ruby style guide), Rust, and most SQL schemas. Underscores separate words unambiguously even in all-lowercase, which is why languages that prize readability lean on it โ€” and why databases, where case-sensitivity can bite, prefer it.

SCREAMING_SNAKE_CASE (CONSTANT_CASE)

All uppercase, underscore-separated: MAX_RETRY_COUNT, API_BASE_URL, DEFAULT_TIMEOUT_MS. Near-universal for constants and for environment variables in .env files, Docker, and CI config. The all-caps shouts "this value is fixed" โ€” when you see it, you know not to reassign it.

kebab-case (dash-case)

All lowercase, hyphen-separated: user-profile, background-color, create-react-app. This is CSS's native format for properties and (via BEM or Tailwind) class names, and it's what URL slugs, npm package names, Kubernetes labels, git branch names, and CLI flags use. Hyphens are natural word separators in plain English, so kebab-case is the most human-readable format for anything people read directly โ€” and it's URL-safe without encoding.

Title Case and Sentence case

Title Case capitalizes major words and leaves short articles, prepositions, and conjunctions lowercase unless they lead: The Quick Brown Fox Jumps Over the Lazy Dog. It's for headlines, book and chapter titles, and slide headers. Sentence case capitalizes only the first word and proper nouns: The quick brown fox jumps over the lazy dog. It's the modern default for UI labels, buttons, and body text in most design systems.

dot.case, path/case, and Train-Case

Three specialist formats: dot.case (com.example.myapp) for Java packages and config keys; path/case (src/components/header) for file paths and module imports; and Train-Case (Content-Type, X-Request-Id) for HTTP headers. You'll convert to these less often, but the Case Converter supports the common ones so you're not doing it by hand.


Which Case Should You Use for Your Programming Language?

The fastest way to stop guessing is to internalize what each language's style guide actually says. Here's the cross-language reference I wish I'd had on that first pull request.

Element JavaScript / TS Python Go Rust CSS / SQL
Variables camelCase snake_case camelCase (private) snake_case snake_case (SQL)
Functions camelCase snake_case PascalCase (public) snake_case โ€”
Classes / structs PascalCase PascalCase PascalCase PascalCase โ€”
Constants SCREAMING_SNAKE SCREAMING_SNAKE PascalCase SCREAMING_SNAKE โ€”
Components / types PascalCase PascalCase PascalCase PascalCase โ€”
Properties / columns camelCase snake_case PascalCase (public) snake_case kebab / snake
Files kebab or Pascal snake_case snake_case snake_case kebab-case

A few things this table won't tell you but experience will. Go treats visibility through case โ€” a capital first letter means exported (public), lowercase means package-private โ€” so casing there is semantics, not style. Python constants are SCREAMING_SNAKE_CASE by convention only; the language won't stop you reassigning them. And in JavaScript, PascalCase does double duty: it marks both classes and React components, which is why JSX can tell <UserCard /> (your component) from <div /> (a DOM element) purely by the capital letter.


How Do You Convert Between Formats with the Tool?

The mechanics are deliberately boring, which is the point.

  1. Open the Case Converter.
  2. Paste your text. It can be in any format โ€” the tool detects word boundaries from spaces, underscores, hyphens, dots, and case changes.
  3. Choose the target format.
  4. The converted text appears instantly. Copy it with one click.

Where it earns its keep is bulk work. The converter processes multi-line input line by line, so an entire list transforms at once. Paste this set of database columns as snake_case:

first_name
last_name
email_address
phone_number
date_of_birth

Pick camelCase, and you get the application-side variables in one step:

firstName
lastName
emailAddress
phoneNumber
dateOfBirth

I do exactly this when I'm mapping a Laravel model's columns to a React form's field names. Two convention worlds, one paste. The alternative โ€” retyping 20 names or writing a one-off transform script โ€” is how a two-minute task becomes ten.


What Are the Most Common Case Conversion Mistakes?

I've made all of these, and I've flagged all of these in review. They cluster into four.

Using the wrong convention for the language. Writing const user_name in JavaScript or firstName = "Alice" in Python is the classic. Linters catch it โ€” ESLint's camelcase rule, Pylint's invalid-name โ€” but it's cleaner to write it right the first time than to get red squiggles.

Being inconsistent within one file. Mixing userName, is_active, and GetUserProfile() in the same Python module is worse than picking the "wrong" convention consistently, because now a reader can't predict anything. Consistency beats personal preference every time.

Mishandling acronyms. This is the subtle one, and it's where I've been burned. Different languages disagree on whether an acronym is one word or a run of letters:

  • JavaScript keeps acronyms fully uppercase: XMLHttpRequest, HTMLElement.
  • C# capitalizes only the first letter: XmlHttpRequest, HtmlElement.
  • Go uppercases the whole acronym, always: XMLHTTPRequest, URL, ServeHTTP.

Here's my admitted mistake with this. I once let an automated converter turn parseHTMLString into parse_h_t_m_l_string across a file โ€” it treated every capital as a word boundary โ€” and I committed it without reading the diff closely. The correct snake_case is parse_html_string. I caught it only when Python couldn't find the function I thought I'd renamed. The lesson: acronym handling is exactly where automated case conversion needs a human glance, and it's why the Case Converter keeps letter runs and adjacent numbers together instead of shattering them.

Splitting numbers wrong. user2FAEnabled should become user_2fa_enabled, not user_2_f_a_enabled. Keeping numeric sequences with their neighboring letters is the behavior you want, and it's easy to get wrong if you convert by naive regex.


Real Conversion Scenarios I Hit Weekly

Porting code between languages. Moving a snippet from a Python service to a Node one means snake_case โ†’ camelCase for every identifier. Paste the block, convert, done.

Component to stylesheet. A React component named UserProfileCard (PascalCase) needs a CSS class user-profile-card (kebab-case). One conversion.

Config to environment. A config key written database.connection.pool.size (dot.case) becomes the env var DATABASE_CONNECTION_POOL_SIZE (SCREAMING_SNAKE_CASE). The converter does the format shift; you just paste and pick.

Title to slug. A headline like "How to Convert Text Case Online" needs a URL slug. For that specific job the Slug Generator is purpose-built, but kebab-case in the Case Converter gets you most of the way.


Frequently Asked Questions

How do I convert text case online?

Open the Case Converter, paste your text, and select the target format. It supports camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, Title Case, Sentence case, dot.case, and more. Conversion is instant, free, and processed entirely in your browser.

What is the difference between camelCase and snake_case?

camelCase joins words with no separators and capitalizes each word after the first: getUserProfile. snake_case uses lowercase words joined by underscores: get_user_profile. camelCase is the standard in JavaScript and Java; snake_case is the standard in Python, Ruby, Rust, and SQL. They encode the same words, just with different separator and capitalization rules.

How do I convert camelCase to snake_case?

Paste your camelCase text into the Case Converter โ€” for example getUserProfile โ€” and choose snake_case. You get get_user_profile instantly. Because the tool detects word boundaries from the capital letters, you don't need to add any spaces or markers first.

What is PascalCase used for?

PascalCase capitalizes the first letter of every word, including the first: UserProfile, HttpClient. It's used for class names in most languages, React and Vue component names, TypeScript interfaces and type aliases, C# methods and properties, and Go's exported (public) identifiers. The capital first letter visually distinguishes types and constructors from ordinary variables.

How should acronyms be cased in variable names?

It depends on the language. JavaScript keeps them fully uppercase (XMLHttpRequest), C# capitalizes only the first letter (XmlHttpRequest), and Go uppercases the entire acronym (XMLHTTPRequest). This is the single most error-prone part of case conversion, so review the result whenever an identifier contains an acronym rather than trusting a blind transform.

Can I convert a whole list of names at once?

Yes. The Case Converter processes multi-line input line by line. Paste a full list of column names or identifiers, pick the target format, and every line converts simultaneously โ€” ideal for mapping database columns to application variables.

Which case should I use for URLs and CSS?

kebab-case for both. URL slugs like /blog/text-case-converter-guide and CSS properties like background-color use all-lowercase words separated by hyphens. It's the most readable format in addresses and stylesheets and is URL-safe without any encoding.

What is SCREAMING_SNAKE_CASE used for?

Constants and environment variables: MAX_RETRY_COUNT, DATABASE_URL, API_KEY. The all-caps signal is a convention, not an enforced rule โ€” it tells the next reader "this value is fixed, don't reassign it." It's near-universal for env vars because shell variables have always been uppercase, and most languages follow the same convention for compile-time constants.

What is the difference between Title Case and Sentence case?

Title Case capitalizes the principal words and leaves short articles, conjunctions, and prepositions lowercase: "The Guide to Text Case Conversion." Sentence case capitalizes only the first word and any proper nouns: "The guide to text case conversion." Title Case is traditional for headlines; sentence case is now the house style at most product and documentation teams because it reads faster and handles long headings better.

How do I change text case in Word or Google Docs?

In Microsoft Word, select the text and press Shift + F3 to cycle through lowercase, UPPERCASE, and Capitalize Each Word, or use the Aa button on the Home tab. Google Docs has Format โ†’ Text โ†’ Capitalization. Neither offers programmer formats โ€” for camelCase, snake_case, or kebab-case you need a dedicated Case Converter.


Conclusion

Case conversion is a small skill that quietly marks the difference between code that reads as native to its language and code that reads as ported from somewhere else. Knowing the right convention for each context โ€” camelCase in JavaScript, snake_case in Python, kebab-case in CSS and URLs, SCREAMING_SNAKE_CASE for constants โ€” prevents linter noise, avoids bugs, and keeps a codebase coherent.

The free Case Converter on toolz.dev makes the mechanical part instant: any format in, any format out, one line or a hundred, all in your browser with nothing uploaded. Bookmark it, and the one part of naming you can automate stops costing you anything.

Convert your text now: toolz.dev/tools/case-converter


Related reading:

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!