Case Converter
Convert text between UPPERCASE, lowercase, Title Case, camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE with one click.
This case converter transforms text between nine common formats: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE. Paste or type text, click a button, and the converted result is ready to copy. All processing runs in your browser - no text is sent to any server.
About Case Converter
What Each Case Format Looks Like
| Format | Example Input | Example Output | Typical Use |
|---|---|---|---|
| UPPERCASE | hello world | HELLO WORLD | Headings, acronyms, constants |
| lowercase | Hello World | hello world | Normalisation, email addresses |
| Title Case | a tale of two cities | A Tale Of Two Cities | Book titles, headlines, UI labels |
| Sentence case | THIS IS A SENTENCE. AND ANOTHER. | This is a sentence. And another. | Body text, paragraphs |
| camelCase | user first name | userFirstName | JavaScript/Java variables, JSON keys |
| PascalCase | user first name | UserFirstName | Class names, React components, C# types |
| snake_case | User First Name | user_first_name | Python variables, database columns, Ruby |
| kebab-case | User First Name | user-first-name | URLs, CSS classes, CLI flags |
| CONSTANT_CASE | max retry count | MAX_RETRY_COUNT | Environment variables, immutable constants |
How Case Conversion Works
Every conversion starts by splitting the input into individual words. The tool detects word boundaries from spaces, underscores, hyphens, and camelCase transitions (a lowercase letter followed by an uppercase letter). Once the words are isolated, each format applies its own rules:
| Format | Word Joining | Capitalisation Rule |
|---|---|---|
| UPPERCASE | Preserve original spacing | All characters to uppercase |
| lowercase | Preserve original spacing | All characters to lowercase |
| Title Case | Preserve original spacing | First letter of each word capitalised |
| Sentence case | Preserve original spacing | First letter of each sentence capitalised, rest lowercase |
| camelCase | No separator (words concatenated) | First word lowercase, subsequent words capitalised |
| snake_case | Underscore between words | All lowercase |
| kebab-case | Hyphen between words | All lowercase |
Line breaks and paragraph structure are preserved across all conversions, so multi-line text keeps its formatting.
Which Naming Convention Does Each Language Use?
Programming languages and frameworks have strong conventions about casing. Using the wrong style will not break your code, but it will look out of place and confuse other developers reading it.
| Language / Context | Variables | Functions | Classes | Constants |
|---|---|---|---|---|
| JavaScript / TypeScript | camelCase | camelCase | PascalCase | UPPER_SNAKE_CASE |
| Python | snake_case | snake_case | PascalCase | UPPER_SNAKE_CASE |
| Ruby | snake_case | snake_case | PascalCase | UPPER_SNAKE_CASE |
| Java | camelCase | camelCase | PascalCase | UPPER_SNAKE_CASE |
| Go | camelCase | camelCase / PascalCase | PascalCase | camelCase (exported = PascalCase) |
| C# / .NET | camelCase | PascalCase | PascalCase | PascalCase |
| CSS | kebab-case | N/A | kebab-case (BEM) | kebab-case (custom properties) |
| SQL | snake_case | snake_case | PascalCase (tables vary) | UPPER_SNAKE_CASE |
| REST APIs (URLs) | kebab-case | N/A | N/A | N/A |
| JSON keys | camelCase (common) or snake_case | N/A | N/A | N/A |
Title Case Style Guide Differences
There is no single standard for Title Case. Different style guides disagree on which short words should remain lowercase. This tool capitalises the first letter of every word for maximum simplicity, which means you may need to manually lowercase a few words depending on your style guide.
| Style Guide | Short Words Left Lowercase | Example |
|---|---|---|
| AP Stylebook | Articles, prepositions under 4 letters, conjunctions | The Art of the Deal |
| Chicago Manual of Style | Articles, prepositions, coordinating conjunctions | The Art of the Deal |
| APA (7th ed.) | Short conjunctions, articles, short prepositions (3 letters or fewer) | The Art of the Deal |
| MLA | Articles, prepositions, coordinating conjunctions | The Art of the Deal |
| Wikipedia | Articles, short prepositions, conjunctions | The Art of the Deal |
In all style guides, the first and last word of a title are always capitalised regardless of length.
Common Mistakes to Avoid
| Mistake | Why It Happens | Correct Approach |
|---|---|---|
| Using camelCase in Python | Coming from JavaScript habits | Use snake_case for variables and functions in Python |
| Mixing kebab-case and camelCase in CSS | Custom properties vs class names confusion | CSS uses kebab-case everywhere: classes, IDs, custom properties |
| snake_case in URL paths | Database column names leaking into URLs | URLs should use kebab-case (hyphens, not underscores) |
| ALL CAPS in email body text | Emphasis | Reads as shouting - use bold or italic instead |
| Inconsistent JSON key casing | Different developers, no linter | Pick one (camelCase is most common) and enforce with a linter |
Converting Between Developer Cases
A single concept often appears in multiple cases across a codebase. A database column called first_name becomes firstName in JavaScript, first-name in a CSS class, and First Name in a UI label. This tool handles all of those transitions. Paste the text in any format and it detects the word boundaries automatically - you do not need to add spaces first.
For example, pasting getUserAccountBalance and selecting snake_case produces get_user_account_balance. The tool recognises the camelCase boundaries and splits correctly.
If you need to turn text into a URL-friendly format with special character handling, the slug generator goes further by stripping accents and punctuation. For counting the words or characters in your text, the word counter runs alongside nicely. All processing happens in your browser - your text never leaves your device.
How Word-Boundary Detection Works
The tool identifies word boundaries before applying a case, so pasting any format as input works without pre-cleaning. The detection logic looks for four signals: a whitespace character, an underscore, a hyphen, or a lowercase-to-uppercase transition. The last rule is what lets getUserAccountBalance be split into get, user, account, and balance even though no separators are present.
Worked example: pasting the string HTTP-ServerConfig_v2 into the converter and selecting snake_case runs through these steps - the hyphen and underscore are treated as separators, the lowercase-to-uppercase gap between Server and Config inserts another split, digits are kept inline, and the result is http_server_config_v2. The same input converted to kebab-case produces http-server-config-v2, and to PascalCase produces HttpServerConfigV2. One input, three valid rewrites - no manual editing required.
Acronyms are the one edge case that most case converters get wrong. XMLHttpRequest has two capital runs (XML and Http) that a naive boundary rule can mis-split. The simplest fix when this matters is to lowercase the acronym first (xmlHttpRequest) then convert, though Google's JavaScript Style Guide and Microsoft's .NET Framework Design Guidelines both recommend treating acronyms longer than two letters as regular Pascal-cased words (XmlHttpRequest) to keep boundary detection predictable.
A Short History of the Naming Conventions
snake_case predates modern programming - it appears in the original 1958 LISP sources and became a fixture of Unix C code through the 1970s and 1980s because the early ASCII terminals rendered underscores reliably and spaces were not legal in identifiers. camelCase gained ground in the 1970s with Smalltalk-72 and then Java's 1995 launch made it the mainstream default for object-oriented languages. kebab-case traces back to Lisp dialects such as Scheme and Clojure, which allow hyphens inside identifiers, and it carried over to CSS in 1996 where hyphenated selectors matched the spec's HTML-like syntax. The term "camelCase" itself was popularised by programmer Newton Love in 1995, though the style had been used informally for decades before.
The phrase "snake_case" is much newer. A 2009 Ruby mailing-list thread is widely credited as the first written use of the term, and it spread through the Ruby and Python communities from there. Before that it was usually called "lowercase with underscores" or simply "lower_case." PEP 8, Python's style guide, formalised snake_case as the convention for functions and variables in 2001.
What Do the Major Style Guides Actually Say?
Different language communities have written the rules down in official documents, so there is no room for personal preference on large projects. The table below links each convention back to the canonical source.
| Source | Scope | Convention Mandated |
|---|---|---|
| PEP 8 (Python.org, 2001, updated ongoing) | Functions, variables, modules | snake_case; classes use CapWords (PascalCase); constants UPPER_SNAKE_CASE |
| Google JavaScript Style Guide | JS / TS identifiers | lowerCamelCase for variables and functions, UpperCamelCase for classes, CONSTANT_CASE for module-level constants |
| Microsoft .NET Framework Design Guidelines | C# public API surface | PascalCase for types, methods, properties; camelCase for parameters and local variables |
| Effective Go (Google, 2012) | Go identifiers | MixedCaps (PascalCase) for exported names; mixedCaps (camelCase) for unexported. Underscores actively discouraged. |
| Ruby Style Guide (community) | Ruby identifiers | snake_case for methods and variables, PascalCase for classes and modules, SCREAMING_SNAKE_CASE for constants |
| CSS WG (W3C) | Selectors, custom properties | kebab-case throughout; specification disallows uppercase in custom-property names |
| Chicago Manual of Style (18th ed., 2024) | Book and article titles in English prose | Capitalise nouns, pronouns, verbs, adjectives, adverbs. Lowercase articles, coordinating conjunctions, and prepositions of four letters or fewer. |
Chicago's 18th edition, released in 2024, introduced the four-letter preposition rule to replace the previous blanket lowercase-prepositions rule. "With" (four letters) now stays lowercase in Title Case; "From" (also four letters) stays lowercase; "Through" (seven letters) gets capitalised. This tool simply capitalises every word, so a style-guide sweep is still useful for anything going into print.
When ALL CAPS Hurts Readability
ALL CAPS is up to 13-18% slower to read than mixed case for passages longer than a single word, according to typographic research summarised by Miles Tinker in "Legibility of Print" (1963) and confirmed by Michael Wogalter and others in modern eye-tracking studies. The reason is word-shape recognition - readers identify common words by their overall outline, and uppercase text reduces every word to a uniform rectangle. Short bursts of ALL CAPS (headings, logos, acronyms, warning labels) still work because they signal emphasis without requiring sustained reading.
Screen readers treat ALL CAPS differently depending on word length. VoiceOver on macOS and NVDA on Windows will spell out single-word all-caps strings letter by letter (reading "NASA" as "N-A-S-A") but read longer all-caps passages as normal words. If you are writing warning text or legal disclaimers, mixed case with bold formatting is usually more accessible than shouting the whole paragraph in capitals.
Sources
- Python.org - PEP 8 Style Guide (Naming Conventions)
- Google JavaScript Style Guide - Naming
- Microsoft .NET Framework Design Guidelines - Capitalization Conventions
- Effective Go - Mixed Caps Convention
- Chicago Manual of Style - Title Capitalization (18th ed.)
- W3C CSS Custom Properties for Cascading Variables
- MDN Web Docs - CSS Reference
Frequently Asked Questions
What text cases are supported?
The tool supports nine transformations: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE. Each conversion handles punctuation and whitespace appropriately for its target format.
How does Title Case work?
Title Case capitalizes the first letter of every word. Common short prepositions, articles, and conjunctions are still capitalized in this implementation for simplicity and consistency across different style guides.
Can I use this for programming variable names?
Absolutely. The camelCase, snake_case, and kebab-case conversions are specifically designed for developers. Paste a sentence or Title Case string and instantly get a properly formatted variable name, CSS class, or URL slug.
Does the converter preserve line breaks?
Yes. Line breaks and paragraph structure are preserved for all case conversions, so you can convert multi-line text without losing your formatting.
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/case-converter/" title="Case Converter - Free Online Tool">Try Case Converter on ToolboxKit.io</a>