Text Case Converter
Convert any text between 10 different string cases instantly. Perfect for renaming variables, formatting titles, or cleaning up data.
Converted text will appear here...
TL;DR
The case you pick is not cosmetic — it is a convention that signals what kind of thing an identifier is. In most codebases, camelCase means a JavaScript variable, PascalCase means a class or React component, snake_case means a Python variable or SQL column, kebab-case means a CSS class or URL slug, and CONSTANT_CASE means a fixed config value. Paste a phrase above, pick a case, copy the result. The reference table below tells you which case the language you are working in actually expects.
Which case goes where: a programmer's reference table
Every case style below converts the same source phrase, user account id, so you can see the shape difference at a glance. The right-hand column is the part most converters skip: where each style is conventionally used, by language and context. Following the convention is what makes your code read as idiomatic to other developers.
| Case style | Example | Conventionally used for |
|---|---|---|
| camelCase | userAccountId | JavaScript / TypeScript variables, function and method names; Java & C# methods, fields, and parameters; JSON keys in most web APIs. |
| PascalCase | UserAccountId | Class, type, interface, and enum names everywhere; React, Vue, and Svelte component names; C# methods and namespaces; Go exported (public) identifiers. |
| snake_case | user_account_id | Python variables and functions (PEP 8); Ruby variables and methods; Rust variables and functions; SQL table and column names; PHP array keys. |
| kebab-case | user-account-id | CSS class names and custom properties; HTML attributes and custom element tags; URL slugs; npm package names; CLI flags (--user-account-id). |
| CONSTANT_CASE | USER_ACCOUNT_ID | Environment variables (.env, shell); compile-time and module-level constants in Python, JS, Java, C; enum members in many style guides. |
| Title Case | User Account Id | Headings, article and page titles, button labels, navigation items, table column headers shown in a UI. |
| Sentence case | User account id | Body copy, tooltips, form field labels, error messages; the preferred UI-text style in Google, Apple HIG, and most modern design systems. |
dot.case (user.account.id) and lowercase/UPPERCASE are also supported in the tool above but are context-specific (Java package fragments, config keys, normalization) rather than identifier conventions.
camelCase vs. PascalCase: the only difference that matters
They are identical except for the very first character. PascalCase capitalizes it; camelCase does not. That one character carries a lot of meaning in most languages:
getUserData // camelCase → a function or variable
GetUserData // PascalCase → a class, type, or React component
const userProfile = ... // camelCase: an instance / value
class UserProfile { ... } // PascalCase: the type itself
<UserProfile /> // PascalCase: JSX treats lowercase
// as an HTML tag, uppercase as a componentIn React this is not just style — it is a hard rule. JSX compiles <button> to the DOM element but <Button> to your component. Lowercase the first letter of a component and React will silently render a non-existent HTML tag instead of throwing. In Go, capitalization is enforced by the compiler in a different way: an uppercase first letter makes an identifier exported (public), lowercase keeps it package-private.
Why converters disagree: the tokenization edge cases
Converting between cases sounds trivial, but the genuinely hard step is splitting the input into words in the first place. Different tools make different choices, which is why you sometimes get surprising output. Here is how acronyms, numbers, and existing casing are handled:
Acronyms (the "HTTP" problem)
An input like parseHTTPResponse can split as parse / HTTP / Response or as parse / H / T / T / P / Response. Google's Java style guide recommends treating acronyms as ordinary words, so the correct camelCase is parseHttpResponse and the correct PascalCase class is HttpResponseParser — not HTTPResponseParser. This is the single biggest source of converter disagreement.
Digits stay attached
oauth2 token normally becomes oauth2Token / oauth2_token — the 2 stays glued to the word before it. Tools that insert a separator before every digit would give you oauth_2_token, which almost no style guide wants.
Mixed and already-cased input
A robust converter treats existing boundaries as hints: it splits on spaces, hyphens, underscores, dots, and on lowercase-to-uppercase transitions. That is how XMLHttpRequest and my-var_name can both round-trip into clean words before being re-joined in the target case.
Common real-world conversions and why you make them
API JSON → database columns. A REST API returns camelCase keys, but your Postgres schema uses snake_case. Convert firstName → first_name when writing the migration or the ORM column mapping.
Porting Python to JavaScript (or back). Python functions are snake_case; the JS equivalents are camelCase. get_user_profile becomes getUserProfile when you move logic to the frontend.
Blog title → URL slug. Convert a Title Case headline to kebab-case for a clean, SEO-friendly path: The State of CSS 2026 → the-state-of-css-2026.
Config key → environment variable. A settings name like databaseUrl becomes DATABASE_URL for a .env file or a Docker environment block.
Component scaffolding. Turn a feature name user settings panel into the PascalCase component UserSettingsPanel and the kebab-case file user-settings-panel.tsx in one pass.
Questions developers ask about case conventions
What is the difference between camelCase and PascalCase?
Only the first letter. PascalCase capitalizes the first letter of every word including the first (UserAccount); camelCase lowercases the first word and capitalizes the rest (userAccount). By convention, PascalCase names types, classes, and React components, while camelCase names variables, functions, and object properties.
Which case should I use in Python?
PEP 8, Python's official style guide, specifies snake_case for variables, functions, and module names; PascalCase (called CapWords) for class names; and CONSTANT_CASE for module-level constants. Python generally avoids camelCase, which is the most common giveaway that code was ported from JavaScript.
Why do CSS classes and URLs use kebab-case instead of camelCase?
Both are case-insensitive in important contexts. HTML attributes and CSS selectors do not reliably preserve case, so a separator is needed to keep words readable, and the underscore is harder to see under a hyperlink's underline, so the hyphen won. Search engines also treat hyphens in URLs as word separators but underscores as joiners, which is why kebab-case slugs are recommended for SEO.
How should acronyms like ID, URL, or HTTP be cased?
Most modern style guides (including Google's) treat acronyms as ordinary words, so you write userId, parseUrl, and HttpClient rather than userID, parseURL, or HTTPClient. This keeps word boundaries unambiguous when a name has several acronyms in a row. Microsoft's .NET guidance differs slightly, capitalizing two-letter acronyms in full (IOStream).
Is it Title Case or Sentence case for UI buttons and labels?
Modern design systems lean toward Sentence case. Google's Material Design and Apple's Human Interface Guidelines both recommend Sentence case for buttons, menu items, and labels because it reads faster and is easier to localize. Title Case is still common for page titles, marketing headlines, and editorial content.
Is my text sent to a server when I convert it?
No. This site is a static export with no backend, and every conversion runs entirely in your browser using plain JavaScript string operations. Your text is never uploaded, stored, or transmitted anywhere, so it is safe to paste internal identifiers or unreleased feature names. The page loads anonymous usage analytics, but those events never include the text you type.