How to use the Case converter
- 1Paste or type your text into the input box.
- 2Choose a case: UPPER, lower, Sentence, Title, Capitalize Each Word, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case, aLtErNaTiNg or iNVERSE.
- 3Check the converted text in the output area.
- 4Copy the result, or pick another style to compare.
How it works
The writing cases change letters but keep your spacing and punctuation. Sentence case lowercases everything and then capitalises the first letter of each sentence. Title Case capitalises the main words but keeps short minor words such as a, an, the, and, of, in and to lowercase unless they start the title. Capitalize Each Word is the simpler version that capitalises every word regardless.
The programming cases first split the text into words, treating spaces, hyphens, underscores, dots and changes from lower to upper case as boundaries. So "user first name", "user-first-name" and "userFirstName" all break into the same three words, which are then joined in the new style.
Conversion is done in your browser, so you can safely paste variable names from private code or unpublished copy.
Worked examples
One phrase, several developer styles
- 1Input: Order total amount
- 2camelCase: orderTotalAmount
- 3PascalCase: OrderTotalAmount
- 4snake_case: order_total_amount
- 5kebab-case: order-total-amount
- 6CONSTANT_CASE: ORDER_TOTAL_AMOUNT
- 7dot.case: order.total.amount
Ready for a JavaScript variable, a class name, a database column, a URL slug, an environment variable and a config key.
Title Case vs Capitalize Each Word
- 1Input: the lord of the rings and the return of the king
- 2Title Case: The Lord of the Rings and the Return of the King
- 3Capitalize Each Word: The Lord Of The Rings And The Return Of The King
Title Case follows headline style; Capitalize Each Word is purely mechanical.
Fixing caps lock
- 1Input: tHANK YOU FOR YOUR ORDER
- 2iNVERSE: Thank you for your order
Inverse case swaps every letter, which undoes accidental caps lock in one step.
Which case should I use in code?
When a codebase already has a convention, follow it. Consistency matters more than which style you pick.
- camelCase: variables and functions in JavaScript, TypeScript and Java.
- PascalCase: classes, types and React components.
- snake_case: variables and functions in Python and Ruby, and many database column names.
- CONSTANT_CASE: constants and environment variables, such as API_BASE_URL.
- kebab-case: URL slugs, CSS class names and file names.
- dot.case: some configuration keys and logging namespaces.
What is the difference between Title Case and Sentence case?
Title Case capitalises the important words, and is common for book titles and headlines in US publications. Sentence case capitalises only the first word and proper nouns, which many style guides and UK newspapers prefer for headings because it reads more naturally. Note that Sentence case cannot know which words are names, so check proper nouns like London or iPhone after converting.
Frequently asked questions
Does Title Case follow AP or Chicago style?
It follows the common rule shared by most styles: minor words like articles, short conjunctions and short prepositions stay lowercase unless they come first. Guides differ on details such as whether to capitalize longer prepositions like between, so review important headlines against your house style.
Will converting to lowercase remove my acronyms?
Yes. Lowercase and Sentence case turn NASA into nasa, because the tool cannot tell an acronym from an ordinary shouted word. Fix acronyms by hand after converting.
Does it work with accented and non-English letters?
Yes. Letters such as é, ß and Cyrillic or Greek characters are converted using the browser's Unicode case rules. Scripts without upper and lower case, like Chinese or Arabic, are left unchanged.
What happens to punctuation in snake_case or kebab-case?
Punctuation and symbols are treated as word separators and dropped, so "Hello, world!" becomes hello_world or hello-world.
What is alternating case used for?
aLtErNaTiNg case is mostly used for jokes and memes to suggest a mocking tone. It is not suitable for anything formal and can be hard for screen readers to read aloud.