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.

Ad
Ad

About Case Converter

What Each Case Format Looks Like

FormatExample InputExample OutputTypical Use
UPPERCASEhello worldHELLO WORLDHeadings, acronyms, constants
lowercaseHello Worldhello worldNormalisation, email addresses
Title Casea tale of two citiesA Tale Of Two CitiesBook titles, headlines, UI labels
Sentence caseTHIS IS A SENTENCE. AND ANOTHER.This is a sentence. And another.Body text, paragraphs
camelCaseuser first nameuserFirstNameJavaScript/Java variables, JSON keys
PascalCaseuser first nameUserFirstNameClass names, React components, C# types
snake_caseUser First Nameuser_first_namePython variables, database columns, Ruby
kebab-caseUser First Nameuser-first-nameURLs, CSS classes, CLI flags
CONSTANT_CASEmax retry countMAX_RETRY_COUNTEnvironment 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:

FormatWord JoiningCapitalisation Rule
UPPERCASEPreserve original spacingAll characters to uppercase
lowercasePreserve original spacingAll characters to lowercase
Title CasePreserve original spacingFirst letter of each word capitalised
Sentence casePreserve original spacingFirst letter of each sentence capitalised, rest lowercase
camelCaseNo separator (words concatenated)First word lowercase, subsequent words capitalised
snake_caseUnderscore between wordsAll lowercase
kebab-caseHyphen between wordsAll 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 / ContextVariablesFunctionsClassesConstants
JavaScript / TypeScriptcamelCasecamelCasePascalCaseUPPER_SNAKE_CASE
Pythonsnake_casesnake_casePascalCaseUPPER_SNAKE_CASE
Rubysnake_casesnake_casePascalCaseUPPER_SNAKE_CASE
JavacamelCasecamelCasePascalCaseUPPER_SNAKE_CASE
GocamelCasecamelCase / PascalCasePascalCasecamelCase (exported = PascalCase)
C# / .NETcamelCasePascalCasePascalCasePascalCase
CSSkebab-caseN/Akebab-case (BEM)kebab-case (custom properties)
SQLsnake_casesnake_casePascalCase (tables vary)UPPER_SNAKE_CASE
REST APIs (URLs)kebab-caseN/AN/AN/A
JSON keyscamelCase (common) or snake_caseN/AN/AN/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 GuideShort Words Left LowercaseExample
AP StylebookArticles, prepositions under 4 letters, conjunctionsThe Art of the Deal
Chicago Manual of StyleArticles, prepositions, coordinating conjunctionsThe Art of the Deal
APA (7th ed.)Short conjunctions, articles, short prepositions (3 letters or fewer)The Art of the Deal
MLAArticles, prepositions, coordinating conjunctionsThe Art of the Deal
WikipediaArticles, short prepositions, conjunctionsThe 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

MistakeWhy It HappensCorrect Approach
Using camelCase in PythonComing from JavaScript habitsUse snake_case for variables and functions in Python
Mixing kebab-case and camelCase in CSSCustom properties vs class names confusionCSS uses kebab-case everywhere: classes, IDs, custom properties
snake_case in URL pathsDatabase column names leaking into URLsURLs should use kebab-case (hyphens, not underscores)
ALL CAPS in email body textEmphasisReads as shouting - use bold or italic instead
Inconsistent JSON key casingDifferent developers, no linterPick 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.

SourceScopeConvention Mandated
PEP 8 (Python.org, 2001, updated ongoing)Functions, variables, modulessnake_case; classes use CapWords (PascalCase); constants UPPER_SNAKE_CASE
Google JavaScript Style GuideJS / TS identifierslowerCamelCase for variables and functions, UpperCamelCase for classes, CONSTANT_CASE for module-level constants
Microsoft .NET Framework Design GuidelinesC# public API surfacePascalCase for types, methods, properties; camelCase for parameters and local variables
Effective Go (Google, 2012)Go identifiersMixedCaps (PascalCase) for exported names; mixedCaps (camelCase) for unexported. Underscores actively discouraged.
Ruby Style Guide (community)Ruby identifierssnake_case for methods and variables, PascalCase for classes and modules, SCREAMING_SNAKE_CASE for constants
CSS WG (W3C)Selectors, custom propertieskebab-case throughout; specification disallows uppercase in custom-property names
Chicago Manual of Style (18th ed., 2024)Book and article titles in English proseCapitalise 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

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>