Text Case Converter
How it works
Type or paste any text into the input area. The tool detects word boundaries automatically and converts the result to every common case at once, so you don't pick a target: you see them all and copy the one you need.
Supported output cases: • camelCase: `myVariableName`. JavaScript, Java, Swift convention for local variables and methods. • PascalCase (UpperCamelCase): `MyVariableName`. Class names in C#, TypeScript, Java, Rust. • snake_case: `my_variable_name`. Python, Ruby, PostgreSQL identifiers, env vars (lowercase). • CONSTANT_CASE (SCREAMING_SNAKE_CASE): `MY_VARIABLE_NAME`. Constants, environment variables. • kebab-case (dash-case): `my-variable-name`. CSS classes, HTML attributes, URL paths. • dot.case: `my.variable.name`. Some config formats, Java packages. • Title Case: `My Variable Name`. Headings, book titles, English orthography. • Sentence case: `My variable name`. Standard prose capitalisation. • UPPER CASE: `MY VARIABLE NAME`. • lower case: `my variable name`. • URL slug: `my-variable-name`. Like kebab-case but stripped of accents and non-ASCII for safe URL use.
How word boundaries are detected. The parser uses four signals to split your input into words: explicit separators (space, dash, underscore, dot, slash), digit ↔ letter transitions (`version2Final` becomes `version 2 final`), uppercase ↔ lowercase transitions (the camelCase boundary: `myVariable` becomes `my variable`), and consecutive uppercase letters followed by a lowercase one (the acronym boundary: `XMLParser` becomes `xml parser`). That is what makes the conversion round-trip: `myUserID` gives `MyUserId` in PascalCase, `my-user-id` in kebab-case, and `myUserId` again on the way back.
When to use which case. The choice is dictated by your language and team convention more than by personal preference. JavaScript and Java code wants camelCase for variables, PascalCase for classes. Python wants snake_case for everything except classes. Rust prefers snake_case for variables and functions, PascalCase for types. CSS uses kebab-case. Database table and column names are typically snake_case, because most SQL dialects are case-insensitive on identifiers and kebab-case would collide with the minus operator. URL slugs use lowercase kebab-case with diacritics stripped, since the RFC 3986 unreserved characters are A-Z a-z 0-9 - . _ ~.
Privacy: text is processed entirely in your browser and nothing is uploaded. DevTools → Network confirms zero outbound requests when you type or copy.
Frequently Asked Questions
What text cases are supported?
- Eleven: camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, dot.case, Title Case, Sentence case, UPPER CASE, lower case, and URL slug. All eleven are shown side by side, and each has its own copy button.
How does it detect word boundaries?
- With four signals: explicit separators (space, -, _, ., /), digit ↔ letter transitions (version2 becomes version 2), camelCase boundaries (myVariable becomes my variable), and acronym boundaries (XMLParser becomes xml parser, not x m l parser). That is what keeps the conversion stable across round-trips.
What's the difference between camelCase and PascalCase?
- The first letter. camelCase starts lowercase (`myVariable`), PascalCase capitalises every word including the first (`MyVariable`). Both concatenate words with no separator, and many languages use both: PascalCase for classes and types, camelCase for variables and methods.
What's the difference between kebab-case and a URL slug?
- The slug is stricter. Both lowercase the words and join them with `-`, but the slug also strips non-ASCII (à becomes a, ü becomes u, é becomes e), removes punctuation that is invalid in URLs, and collapses consecutive separators. Use kebab-case for CSS classes and HTML attributes, the slug for URL paths.
Why is snake_case so common in Python?
- Because PEP 8, Python's official style guide since 2001, recommends it for functions, variables and module names, reserving CamelCase for classes. It fits the language's preference for explicit readability and lets you tell data (snake) from types (camel) at a glance.
Are accented characters handled correctly?
- Yes. In camelCase, snake_case and the other identifier cases, accented characters are preserved as-is, which is what you want when working with non-English content. The URL slug case is the exception: it NFD-normalizes and strips combining marks (à to a, ñ to n, ü to u) so the result is RFC-3986-safe.
Is my text stored anywhere?
- No. Conversion is pure JavaScript running in your browser tab. The tool is stateless: input goes in, all 11 cases come out, nothing is logged and no localStorage is written. Open DevTools → Network and you will see zero outbound calls while you type.
Naming conventions by language and context
What case to use for which identifier in mainstream languages and contexts. When in doubt, follow the project's existing convention; cross-language code (FFI, JSON APIs) typically follows the consumer's convention.
| Context | Identifier type | Convention | Example |
|---|---|---|---|
| JavaScript / TypeScript | Variables, functions | camelCase | userName, getUserData() |
| JavaScript / TypeScript | Classes, interfaces, types | PascalCase | UserAccount, IUserRepo |
| JavaScript / TypeScript | Constants | CONSTANT_CASE | MAX_RETRIES, API_BASE_URL |
| Python | Functions, variables, modules | snake_case | user_name, get_user_data() |
| Python | Classes | PascalCase | UserAccount |
| Python | Constants | CONSTANT_CASE | MAX_RETRIES |
| Rust | Variables, functions, modules | snake_case | user_name, get_user_data() |
| Rust | Types, traits, enums | PascalCase | UserAccount, Iterator |
| Java | Variables, methods | camelCase | userName, getUserData() |
| Java | Classes, interfaces | PascalCase | UserAccount |
| Java | Packages | lowercase / dot.case | com.example.app |
| Java | Constants | CONSTANT_CASE | MAX_RETRIES |
| C# / .NET | Public methods, properties, types | PascalCase | UserAccount, GetUserData() |
| C# / .NET | Local variables, parameters | camelCase | userName |
| Ruby | Variables, methods | snake_case | user_name, get_user_data |
| Ruby | Classes, modules | PascalCase | UserAccount |
| Ruby | Constants | CONSTANT_CASE | MAX_RETRIES |
| Go | Exported (public) names | PascalCase | UserAccount, GetUserData() |
| Go | Unexported (private) names | camelCase | userAccount, getUserData() |
| CSS / HTML | Class names, IDs, attributes | kebab-case | .user-account, [data-user-id] |
| HTML | Element names | lower case | <div>, <span> |
| SQL | Tables, columns | snake_case | user_accounts, created_at |
| JSON / REST APIs | Property keys | camelCase or snake_case | userName / user_name |
| Environment variables | All shells, .env | CONSTANT_CASE | DATABASE_URL, API_KEY |
| Filenames (OS-portable) | Source files | kebab-case or snake_case | user-account.ts, user_account.py |
| URL paths | Slugs | URL slug | /blog/my-first-post |
| YAML config | Keys | kebab-case or snake_case | max-retries: 3 |
Conventions are derived from each language's official style guide where one exists (PEP 8, Effective Java, Rust API guidelines, Google Java Style, Microsoft .NET Framework Design Guidelines) and from prevailing community practice elsewhere. Match the existing codebase's choice when contributing: consistency beats correctness for naming.