Case Converter
camel, snake, kebab, title and sentence case
Naming conventions are how code signals what a thing is, and each ecosystem picked a different one. JavaScript and Java use camelCase for variables and PascalCase for types; Python and Ruby use snake_case; CSS classes, URLs and file names lean on kebab-case; environment variables and constants shout in CONSTANT_CASE.
The conversions look trivial and are not quite. Turning a phrase into camelCase means finding the word boundaries first, and boundaries hide in mixed case, in digits, and in acronyms — HTTPServer is two words, or three, depending on your rule. This tool applies consistent boundary detection so an identifier survives a round trip instead of degrading each time.
How to use it
- Paste the text or identifierA sentence, a variable name or a whole list of them; each line is converted independently so you can transform a block at once.
- Pick the target casecamelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case and sentence case are all produced from the same parsed word list.
- Check the acronymsRuns of capitals are where conventions genuinely disagree. Look at how yours came out before pasting a hundred renamed identifiers into a codebase.
Frequently asked questions
What is the difference between camelCase and PascalCase?
Only the first letter. camelCase starts lower case and capitalises each subsequent word; PascalCase capitalises the first too. The convention in most C-family languages is PascalCase for types and classes, camelCase for variables and functions, which lets a reader tell them apart without looking anything up.
When should I use kebab-case rather than snake_case?
Kebab-case wherever a hyphen is legal and an underscore is awkward: CSS class names, HTML attributes, URL slugs, npm package names and file names on the web. Snake_case where a hyphen would be parsed as subtraction — which is to say inside most programming languages, since identifiers cannot contain hyphens.
How are acronyms handled?
This is the genuinely contested case. Some style guides write parseHTTPResponse, others parseHttpResponse. The second is easier to convert mechanically, because a run of capitals is otherwise ambiguous — HTTPServer could split as HTTP Server or as H T T P Server. Google’s style guides recommend treating acronyms as ordinary words for exactly that reason.
What is the difference between title case and sentence case?
Title case capitalises the significant words and leaves short articles and prepositions lower case; sentence case capitalises only the first word and any proper nouns. Interface copy increasingly uses sentence case because it reads as less shouty and is far easier to apply consistently across a product.
Do digits count as word boundaries?
It depends on the convention, and the disagreement is real: address2 might become address_2 or address2. Neither is wrong, but a codebase should pick one, because inconsistency here breaks automated renaming and makes search unreliable.