Naming things is one of the two hard problems in computer science. The other is cache invalidation and off-by-one errors. But before you can even debate whether a variable should be called userId or user_id, you need to know what case convention your codebase, API, or framework expects. A single mismatch can break JSON parsing, violate style guides, or cause a 400 Bad Request from a third-party API that insists on snake_case.
We built our free Text Case Converter to eliminate that friction. Paste any text and see it instantly transformed into twelve standard case formats: camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, dot.case, path/case, lower case, UPPER CASE, Title Case, Sentence case, and even aLtErNaTiNg CaSe. It runs entirely in your browser — no server, no signup, no data leaves your machine.
What Is a Text Case Converter?
A text case converter is a utility that transforms a string of words from one naming convention to another. At its core, the tool performs three operations: splitting the input into individual words (tokenization), optionally modifying each word (capitalization, lowercasing, uppercasing), and rejoining the words with a specific delimiter or boundary rule.
The complexity lies in tokenization. Human-readable text contains spaces, punctuation, and mixed capitalization. A robust converter must handle all of these:
hello world(space-separated)hello-world(kebab-separated)hello_world(snake-separated)helloWorld(camelCase boundary)HelloWorld(PascalCase boundary)hello.world(dot-separated)hello/world(path-separated)
A naive split-on-spaces approach would fail on most of these. A production-grade converter must detect boundaries between lowercase and uppercase letters, handle consecutive capitals (like XMLParser), and normalize multiple delimiters into clean word arrays before reconstructing the output.
The Twelve Case Formats Every Developer Should Know
Here is a complete reference to the twelve case formats supported by our converter, with their rules, typical use cases, and examples derived from the input free online text case converter:
| Case Format | Rule | Example | Common Use |
|---|---|---|---|
| camelCase | First word lowercase, subsequent words capitalized, no delimiter | freeOnlineTextCaseConverter | JavaScript variables, Java methods, JSON keys in some APIs |
| PascalCase | Every word capitalized, no delimiter | FreeOnlineTextCaseConverter | Class names, C# types, React components, TypeScript interfaces |
| snake_case | All lowercase, underscore delimiter | free_online_text_case_converter | Python variables, Ruby, PostgreSQL columns, Rust enums, C constants |
| CONSTANT_CASE | All uppercase, underscore delimiter | FREE_ONLINE_TEXT_CASE_CONVERTER | Environment variables, C macros, configuration keys, compile-time constants |
| kebab-case | All lowercase, hyphen delimiter | free-online-text-case-converter | CSS class names, URL slugs, HTML attributes, Laravel config keys |
| dot.case | All lowercase, period delimiter | free.online.text.case.converter | Unix config files, CSS custom properties (variables), namespaced keys |
| path/case | All lowercase, slash delimiter | free/online/text/case/converter | File paths, namespace paths, nested object access patterns |
| lower case | All lowercase, space delimiter | free online text case converter | Normalization, search indexing, case-insensitive comparison |
| UPPER CASE | All uppercase, space delimiter | FREE ONLINE TEXT CASE CONVERTER | Headlines, emphasis, SQL keywords, some configuration formats |
| Title Case | Major words capitalized, minor words lowercase unless first or last | Free Online Text Case Converter | Blog post titles, book titles, UI labels, presentation slides |
| Sentence case | First word capitalized, rest lowercase | Free online text case converter | Sentences, form labels, tooltips, alt text, body copy |
| aLtErNaTiNg CaSe | Alternating lowercase and uppercase letters | fReE OnLiNe tExT CaSe cOnVeRtEr | Memes, sarcasm, testing font rendering, visual stress testing |
Programming Language Case Conventions
Every programming ecosystem has adopted conventions. Violating them does not stop code from compiling, but it signals inexperience to other developers and can trigger linting errors in CI pipelines.
JavaScript / TypeScript
JavaScript uses camelCase for variables and functions, PascalCase for classes and constructor functions, and UPPER_SNAKE_CASE (or CONSTANT_CASE) for constants and enums. The Airbnb and Google style guides both enforce these rules via ESLint. React components must be PascalCase or the JSX transform will not recognize them as components.
Python
PEP 8 mandates snake_case for variables, functions, and methods. Classes use PascalCase (called CapWords in PEP 8). Constants at module level use UPPER_SNAKE_CASE. The Python standard library follows these rules religiously, and tools like flake8 and pylint will flag violations.
Ruby
Ruby follows a similar convention to Python: snake_case for variables and methods, PascalCase for classes and modules. Constants use PascalCase (unlike Python, where constants are uppercase). Rails adds further conventions: database table names are plural snake_case, model names are singular PascalCase.
Go
Go is explicit about visibility through case: identifiers starting with an uppercase letter are exported (public), while lowercase identifiers are package-private. This makes PascalCase and snake_case not just stylistic but semantic. The standard library uses camelCase for unexported variables and PascalCase for exported ones.
Rust
Rust uses snake_case for variables, functions, and file names. Types, traits, and enums use PascalCase. Constants and statics use UPPER_SNAKE_CASE. The compiler itself warns about non-idiomatic naming via the non_snake_case lint.
CSS and HTML
CSS historically used kebab-case for class names (for example, .main-content), though methodologies like BEM extend this to .block__element--modifier. HTML attributes are kebab-case by specification. CSS custom properties (variables) often use --dot.case or --kebab-case for theming.
SQL
SQL is case-insensitive for keywords, but identifiers vary by database. PostgreSQL folds unquoted identifiers to lowercase, so CREATE TABLE UserData creates a table named userdata. To preserve case, you must quote: CREATE TABLE "UserData". MySQL behavior depends on the file system and configuration. SQL style guides generally recommend snake_case for tables and columns.
Real-World Case Conversion Scenarios
Case conversion is not an academic exercise. Here are real workflows where developers convert text between cases daily:
- API integration: Your backend returns
snake_caseJSON, but your JavaScript frontend expectscamelCase. You write a utility to recursively transform keys, or use a library likehumps. - Code generation: You generate TypeScript interfaces from a database schema where columns are
snake_case. The generated code must bePascalCasefor interface names andcamelCasefor properties. - URL routing: A CMS stores page titles in
Title Case, but your SEO team requireskebab-caseURL slugs. You need a robust slugifier that handles Unicode, removes stop words, and prevents collisions. - Configuration migration: Moving from a dotenv file (
UPPER_SNAKE_CASE) to a YAML config (kebab-caseordot.case) requires batch renaming across hundreds of environment-specific files. - Localization: Translators deliver copy in
Sentence case, but your design system usesTitle Casefor buttons andUPPER CASEfor badge labels. Manual editing across 40 languages is error-prone. - Documentation: Writing README files where code examples need to match the conventions of multiple languages. A single concept like "user profile settings" becomes
userProfileSettings,UserProfileSettings,user_profile_settings, anduser-profile-settingsdepending on the snippet.
How Case Conversion Works Under the Hood
The algorithm behind a text case converter is conceptually simple but requires care at the edges. Here is the general approach:
- Tokenization: Split the input string into words. This means handling spaces, hyphens, underscores, dots, slashes, and camelCase / PascalCase boundaries. A regex like
/[^a-zA-Z0-9]+/catches most delimiters, but detecting camelCase boundaries requires an additional pass:replace(/([a-z0-9])([A-Z])/g, '$1 $2')andreplace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2'). - Normalization: Convert each token to a consistent internal representation, typically lowercase. This ensures that
HELLO,Hello, andhelloall produce the same output regardless of the target case. - Reconstruction: Apply the target case rules. camelCase lowercases the first word and capitalizes subsequent ones, then removes delimiters. snake_case lowercases everything and joins with underscores. PascalCase capitalizes every word and removes delimiters.
- Edge case handling: Consecutive capitals like
XMLParsermust be handled carefully. A naive boundary detector would producex_m_l_parser, which is wrong. Better implementations recognize runs of capitals as a single acronym unless followed by a lowercase letter.
Here is a minimal but robust case converter in JavaScript that handles the most common scenarios:
function splitWords(str) {
return str
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
.split(/[^a-zA-Z0-9]+/)
.filter(w => w.length > 0);
}
function toCamelCase(str) {
const words = splitWords(str);
return words[0].toLowerCase() +
words.slice(1).map(w => w[0].toUpperCase() + w.slice(1).toLowerCase()).join('');
}
function toSnakeCase(str) {
return splitWords(str).map(w => w.toLowerCase()).join('_');
}
function toKebabCase(str) {
return splitWords(str).map(w => w.toLowerCase()).join('-');
} Comparison: Online Tool vs. Command Line vs. Programming
| Approach | Speed | Batch | No Setup | Best For |
|---|---|---|---|---|
| Online converter | Instant | Limited | Yes | Quick one-off conversions, non-technical users, mobile |
| Command line | Fast | Yes | No | Scripts, CI pipelines, batch renaming |
| IDE / Editor | Fast | Sometimes | No | Refactoring, renaming symbols across a codebase |
| Programming | Variable | Yes | No | Data pipelines, code generation, custom logic |
Frequently Asked Questions
Does this tool store my text?
No. The conversion runs entirely in your browser using JavaScript. Your text is never sent to a server, logged, or stored. For extra privacy, you can use the tool offline after the initial page load.
Can I convert multiple strings at once?
The online tool processes one input at a time and shows all twelve case formats simultaneously. For batch conversion, use the command line or a script. Tools like rename, sed, or a short Python/JavaScript script are better suited for bulk operations.
Does it handle Unicode and accented characters?
Yes. The tokenizer splits on non-alphanumeric characters using Unicode-aware logic, so accented characters, Cyrillic, and other scripts are preserved in the output. The word boundary detection for camelCase and PascalCase is ASCII-centric, which is the correct behavior for programming identifiers.
What is the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (myVariableName), while PascalCase starts with an uppercase letter (MyVariableName). PascalCase is also called UpperCamelCase or StudlyCase. In many languages, PascalCase is reserved for types and classes, while camelCase is used for variables and functions.
When should I use kebab-case vs. snake_case?
Use kebab-case for URLs, CSS classes, and HTML attributes. Use snake_case for programming variables, database columns, and filenames in Unix environments. The key difference is that kebab-case uses hyphens, which are valid in URLs and CSS but can be misinterpreted as subtraction operators in programming languages. Snake_case uses underscores, which are safe in nearly all programming contexts.
What is CONSTANT_CASE used for?
CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) is used for values that should not change at runtime: environment variables, compile-time constants, configuration keys, and enum variants. The uppercase makes them visually distinct from mutable variables, signaling immutability and global scope.
Does Title Case capitalize every word?
No. Our Title Case implementation follows standard English title capitalization rules: major words (nouns, verbs, adjectives, adverbs) are capitalized, while minor words (articles, short prepositions, coordinating conjunctions) remain lowercase unless they are the first or last word. This produces The Quick Brown Fox Jumps over the Lazy Dog rather than the mechanical The Quick Brown Fox Jumps Over The Lazy Dog.
Can I use this tool offline?
Yes. Once the page loads, it works without an internet connection. You can install it as a PWA on mobile or bookmark it for quick access.
Is there an API?
Not currently. The tool is designed for interactive use. If you need programmatic case conversion, the JavaScript code snippet in the "How It Works" section above is a good starting point. Libraries like change-case (npm) and inflection (Ruby) provide comprehensive case conversion for production codebases.
Why does my input with numbers look strange in some cases?
Numbers are treated as word characters and preserved in place. For example, user123Name becomes user123_name in snake_case. If you need numbers to act as delimiters, add a space or hyphen around them before converting.
Ready to convert? Try the free Text Case Converter now — no signup, no data collection, instant results in twelve formats. If you are working with structured data, you might also find our JSON Tools, Base64 Tool, and Hash Generator useful.