About this case converter
This case converter rewrites the capitalization of any text: uppercase to lowercase and back, headline-style Title Case, Sentence case, and five naming styles programmers use for variables, constants, files and URLs. Pick a style and the result updates as you type. The conversion runs in your browser with JavaScript, so nothing you paste is uploaded.
How to use it
- Paste or type text into the box. A sample heading is loaded so you can see the output.
- Click a style. The highlighted button is the one applied; editing the text re-runs it.
- For Title Case, choose a rule set: Standard keeps short connecting words lowercase, Simple capitalizes every word.
- Copy the result. Each line is converted separately, so a pasted list of headings or column names stays one item per line.
Every case style, with examples
This table shows each style applied to the sample text, a guide to the art of writing clean code, exactly as the tool outputs it:
| Style | Output | Typical use |
|---|---|---|
| UPPERCASE | A GUIDE TO THE ART OF WRITING CLEAN CODE | Labels, acronyms, emphasis |
| lowercase | a guide to the art of writing clean code | Fixing Caps Lock text, tags, email addresses |
| Title Case (Standard) | A Guide to the Art of Writing Clean Code | Headlines, book and article titles |
| Title Case (Simple) | A Guide To The Art Of Writing Clean Code | Menu items, some product names |
| Sentence case | A guide to the art of writing clean code | Body text, UI buttons, many web headings |
| camelCase | aGuideToTheArtOfWritingCleanCode | JavaScript and Java variables and functions |
| PascalCase | AGuideToTheArtOfWritingCleanCode | Class and type names |
| snake_case | a_guide_to_the_art_of_writing_clean_code | Python and Rust functions, database columns |
| CONSTANT_CASE | A_GUIDE_TO_THE_ART_OF_WRITING_CLEAN_CODE | Constants, environment variables |
| kebab-case | a-guide-to-the-art-of-writing-clean-code | URLs, CSS classes, file names |
How the Title Case converter treats small words
The Standard rule set lowercases these 17 words: a, an, the, and, but, for, nor, or, as, at, by, in, of, on, per, to, via. They are still capitalized when they are the first or last word of a line, or when they follow a colon, period, question mark or exclamation mark. So what are you looking for becomes What Are You Looking For, and star wars: a new hope becomes Star Wars: A New Hope. Every other word gets a capital first letter, skipping leading quotes or brackets, and the rest of the word is lowercased.
This is a common core of headline style, not an exact copy of the AP Stylebook or the Chicago Manual of Style. Those guides differ on longer prepositions and on hyphenated compounds, and some of their rules depend on how a word is used in the sentence, which a converter cannot see. Hyphenated words are treated as one word here, so state-of-the-art becomes State-of-the-art. For a publication with a house style, convert first and then check the small words by hand.
Why Sentence case can't know proper nouns
Sentence case lowercases everything, then capitalizes the first letter of the text and the first letter after a period, question mark or exclamation mark followed by a space. It also turns a standalone i into I. That is all it can do safely. Whether "apple" is fruit or a company, or "bill" is an invoice or a person, depends on meaning that a letter-by-letter rule cannot see. So star wars: a new hope becomes Star wars: a new hope, and names, places, brands and acronyms need to be capitalized again by hand. Abbreviations cause the opposite problem: in i.e. yes, the space after the period makes Yes look like the start of a sentence.
Which case developers use where
- Python: PEP 8 says function and variable names should be lowercase with underscores (snake_case), class names should use CapWords (PascalCase), and constants are written in capitals with underscores.
- Rust: the Rust API Guidelines use
UpperCamelCasefor types and traits,snake_casefor functions, methods and local variables, andSCREAMING_SNAKE_CASEfor constants and statics. - JavaScript and Java: MDN calls camel case the most popular convention in both languages; built-in names such as
encodeURIComponentandArrayBuffershow the lower and upper forms. - CSS, HTML and URLs: CSS properties such as
background-colorand attributes such asaria-labelare kebab case, as MDN notes. For web addresses, Google Search Central recommends hyphens instead of underscores to separate words.
How the code styles split words
The five code styles first break each line into words. Any character that is not a letter or digit is a separator, so spaces, hyphens, underscores, dots and brackets all split words and never appear in the output. A lowercase letter followed by a capital also starts a new word, and so does the last capital of an acronym before a lowercase letter. That lets you convert existing identifiers directly: customerFirstName becomes customer_first_name, and XMLHttpRequest becomes xml_http_request. Apostrophes inside a word are dropped, so don't stop becomes dontStop. Accented letters are kept, so café au lait becomes caféAuLait; remove accents first if your language or system only accepts ASCII names.
Letters that don't convert one-to-one
UPPERCASE and lowercase use the browser's language-neutral Unicode case mapping. The German ß has no single capital in that mapping, so straße becomes STRASSE, one character longer. Turkish dotted and dotless i are not handled, so istanbul becomes ISTANBUL, not the Turkish İSTANBUL.
Worked example
With the sample text and the default Standard style, Title Case gives A Guide to the Art of Writing Clean Code. A is capitalized because it is the first word; to, the and of are on the small-word list and stay lowercase. Switch to Simple and every word is capitalized. Click snake_case and the same text becomes a_guide_to_the_art_of_writing_clean_code.
Common mistakes
- Losing acronyms. Title Case and Sentence case lowercase the rest of each word, so
NASAbecomesNasa. Re-type acronyms afterwards, or fix them in bulk with Find and Replace. - Names with inner capitals.
o'neillbecomesO'neillandmcdonaldbecomesMcdonald. - Stray spaces. Text pasted from documents can carry double spaces or non-breaking spaces. Run it through the Text Cleaner first.
To check the length of the result, paste it into the Word Counter.
Frequently asked questions
Paste the text and click lowercase. Every letter is lowered using the browser's Unicode case mapping, so accented capitals such as É become é too. To capitalize only the start of each sentence instead, click Sentence case, which lowercases the text first and then capitalizes sentence starts.
With the Standard style, these 17 words stay lowercase unless they are the first or last word or follow a colon or sentence-ending punctuation: a, an, the, and, but, for, nor, or, as, at, by, in, of, on, per, to, via. Choose the Simple style to capitalize every word instead.
Sentence case only knows where sentences start. It cannot tell whether a word is a proper noun, so names, places, brands and acronyms are lowercased with everything else. The one exception is the pronoun I, which is capitalized when it stands alone. Re-capitalize proper nouns by hand after converting.
camelCase joins words with no separator and capitalizes each word after the first, as in myVariableName, and is the usual style for JavaScript and Java variables. snake_case joins lowercase words with underscores, as in my_variable_name, and is what PEP 8 recommends for Python function and variable names.
Both join words without separators and capitalize each new word. camelCase starts with a lowercase letter, as in orderTotal, while PascalCase also capitalizes the first letter, as in OrderTotal. Many languages use PascalCase for class or type names and camelCase for variables and functions.
Paste the camelCase names, one per line, and click snake_case. The converter starts a new word wherever a lowercase letter is followed by a capital, so customerFirstName becomes customer_first_name. Acronyms are split too, so XMLHttpRequest becomes xml_http_request.
No. All case conversion happens locally in your browser with JavaScript, and nothing you type or paste is sent to a server. The page keeps working if you go offline after it has loaded.