Writers reach for this most often to fix a heading typed in the wrong case or to standardise a list of product names. Developers reach for it constantly for a different reason entirely: naming conventions are not optional in code, and converting a single concept between camelCase for a JavaScript variable, snake_case for a Python one and kebab-case for a URL slug is a task that comes up every day and is tedious to do by hand correctly.
Every conversion runs locally in your browser as plain string manipulation. Nothing you paste is uploaded or logged, so this case converter is exactly as safe to use on a proprietary code identifier as it is on a public blog title.
The eleven case styles this case converter supports
Each style follows a specific, consistent rule rather than a rough approximation, which matters most for the programming case styles where a single misplaced capital letter breaks a variable reference.
- UPPER CASE: every letter capitalised, used for emphasis and acronyms.
- lower case: every letter lowercased, used for URLs and case insensitive matching.
- Title Case: the first letter of each word capitalised, used for headings and titles.
- Sentence case: only the first letter of each sentence capitalised, the normal style for prose.
- camelCase: no spaces, first word lowercase, each following word capitalised, the JavaScript variable convention.
- PascalCase: no spaces, every word capitalised including the first, the convention for class and component names.
- snake_case: words lowercased and joined with underscores, the Python and database column convention.
- kebab-case: words lowercased and joined with hyphens, the URL slug and CSS class convention.
- CONSTANT_CASE: words uppercased and joined with underscores, the convention for constants and environment variables.
- aLtErNaTiNg case: case flips with every character, mostly used for stylised or mocking text.
- iNVERSE CASE: every character's case is flipped from the original, upper becomes lower and lower becomes upper.
When each case style is the right choice
Title case and sentence case are prose choices. Style guides disagree on exactly which words to capitalise in title case, so this text case converter uses the common approach of capitalising the first letter of every word, which you can then hand adjust for the handful of short connecting words a strict style guide wants left lowercase.
camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE are naming convention choices rather than style choices, and mixing them within one codebase or file causes real problems, not just an inconsistent look. JavaScript and Java use camelCase for variables and PascalCase for classes and components. Python and most SQL databases use snake_case. URLs, CSS class names and command line flags use kebab-case. Environment variables and true constants use CONSTANT_CASE.
How word boundaries are detected for programming cases
Converting into or between the programming case styles first requires splitting the input into individual words, and this case converter detects boundaries from spaces, hyphens, underscores and from a lowercase letter followed directly by an uppercase letter, so 'user profile', 'user-profile', 'user_profile' and 'userProfile' all split into the same two words before being reassembled in the target style.
That means you can paste text already in one programming case and convert it directly to another. A snake case converter and a camel case converter are really just this same boundary detection running with a different joiner on the output side, an underscore for one and a capital letter for the other, which is why this tool treats all five programming styles as different output formats of the same underlying word list rather than as five separate features.
Reversible and non reversible conversions
Converting to upper, lower, title or sentence case is not reversible, since capitalisation information about the original text is discarded the moment every letter is forced to one case. Converting from camelCase to snake_case and back, however, is reversible in practice because the word boundaries are preserved through the underscore or hyphen, only the separator and the capitalisation convention change.
The alternating and inverse styles are a special case. Inverse case is fully reversible, running the same conversion twice returns the original text exactly. Alternating case is not reversible in the same way, since it assigns case based on character position rather than on the original capitalisation.
How to use this case converter
- 1
Paste your text
Drop a text file or paste any text, from a single word to a full paragraph, into the input box.
- 2
Choose a case style
Pick from all eleven styles including camelCase, snake_case, kebab-case and CONSTANT_CASE.
- 3
Review the live preview
The converted text appears immediately below as you change styles, so you can compare options quickly.
- 4
Copy or download the result
Press convert to finalise the result, then copy it to your clipboard or download it as a text file.
Related tools worth bookmarking
Sources and further reading
- MDN: String.prototype.toUpperCaseThe browser method this case converter uses for upper case conversion, including its locale aware behaviour.developer.mozilla.org
- Unicode FAQ: Case MappingExplains why upper and lower case conversion is not always a simple one to one character swap across scripts.unicode.org
- ECMA-262: ECMAScript Language SpecificationThe specification defining JavaScript identifier syntax, the basis for the camelCase and PascalCase naming rules.ecma-international.org
Frequently asked questions
Common questions about the case converter.
camelCase starts with a lowercase letter and capitalises every word after the first, for example userProfileName, and is the standard for variables and functions in JavaScript. PascalCase capitalises every word including the first, for example UserProfileName, and is the standard for class names, React components and type names.
Yes. Word boundaries are detected from spaces, hyphens, underscores and from capital letters that follow a lowercase letter, so text that mixes styles, such as a partly camelCase and partly hyphenated identifier, is still split into the correct set of words before being reassembled in the target case.
Yes, and this is one of the most common conversions developers need. Paste the snake_case text, choose kebab-case as the output, and the underscores are recognised as word boundaries, so the words are rejoined with hyphens and lowercased, giving a correct kebab-case result in one step.
In this title case converter, yes, title case capitalises the first letter of every word and lowercases the rest. Formal style guides such as newspaper or academic manuals sometimes leave short connecting words like a, of and the in lowercase, which this case converter does not attempt to guess, since the exact list of exceptions varies between style guides.
Numbers are treated as part of the word they are attached to and are left unchanged by any case style, since digits have no upper or lower case form. Punctuation is preserved in the prose styles, upper, lower, title and sentence case, but is used only as a word boundary and then discarded in the programming case styles, since identifiers cannot contain punctuation.
Yes, for letters. Inverse case flips every letter's case individually, so applying it twice returns each letter to its starting case and reproduces the original text exactly, provided no other case conversion was applied in between. Numbers, spaces and punctuation are unaffected either way since they have no case to flip.