Tools

Case converter: title case, sentence case and code cases

Paste your text, press a button. Title Case follows real style-guide rules rather than capitalising every word blindly.

Everyday cases

Code cases

Clean-up

Nothing you type or paste on this page is sent anywhere. The whole tool is a few kilobytes of JavaScript running in your browser — it works with the network disconnected.

How to use this case converter

Paste your text into the box and press whichever button you need. Each conversion replaces the text in place, so you can chain them — trim the extra spaces first, then apply title case. The undo button steps back through the last thirty changes, which saves you re-pasting when you press the wrong one.

Title Case done properly

Most online case converters capitalise the first letter of every word and call it title case. That gives you "The Rise And Fall Of The Roman Empire", which no publication would print. Real title case, as used by the Chicago Manual of Style, the AP Stylebook and essentially every editorial house, lowercases short function words unless they are the first or last word of the title.

This converter lowercases articles (a, an, the), coordinating conjunctions (and, but, or, nor) and short prepositions (of, in, on, at, to, for, by, with, from), while always capitalising the first and last word regardless. The result is "The Rise and Fall of the Roman Empire" — which is what you wanted.

It also leaves existing all-caps words alone, so "The Future of AI in NHS Trusts" keeps its acronyms instead of becoming "The Future Of Ai In Nhs Trusts". Style guides genuinely disagree on some details: Chicago capitalises prepositions of five letters or more ("Through", "Between") while AP uses four. The list here follows the shorter, more common convention. For a book title or an academic citation, check the result against your required style guide rather than trusting any tool blindly.

Sentence case

Sentence case lowercases everything, then capitalises the first letter of each sentence and the standalone pronoun "I". This is what you want for headlines in most modern digital style guides — the BBC, the Guardian and most product interfaces all use sentence case for headings now, because it reads faster and looks less shouty than title case.

One caveat worth knowing: because the tool lowercases first, proper nouns lose their capitals. "Meeting with Sarah in London on Tuesday" becomes "Meeting with sarah in london on tuesday". There is no reliable way to detect proper nouns without a language model, and quietly guessing would be worse than being predictable. Fix names by hand afterwards, or use sentence case on text that has none.

The code cases

All six programming cases share one tokeniser, which is why they behave consistently. It splits on any non-alphanumeric character, splits again at lowercase-to-uppercase boundaries, and strips accents. That means myVariableName, my-variable-name, My Variable Name and my_variable_name all produce identical tokens, so you can convert freely between any two conventions without an intermediate step.

  • camelCase — JavaScript and Java variables, JSON keys in most APIs
  • PascalCase — class names in most languages, React components, C# everything
  • snake_case — Python variables and functions, Ruby, SQL column names
  • CONSTANT_CASE — constants and environment variables in almost every language
  • kebab-case — CSS class names, HTML attributes, URL slugs, npm package names
  • dot.case — configuration keys, namespaced properties, some logging conventions

Clean-up operations

Trim extra spaces collapses runs of spaces and tabs into one, removes trailing spaces at line ends, reduces three or more blank lines to a single blank line, and trims the whole block. This is the fix for text pasted out of a PDF or a badly formatted email, where invisible whitespace is scattered everywhere.

Remove line breaks joins everything into one paragraph. Use it on text copied from a PDF column, where every visual line ends with a hard break and the text will not reflow.

Make URL slug strips accents, lowercases, and replaces every run of non-alphanumeric characters with a single hyphen — so "Café & Restaurant Guide 2026" becomes cafe-restaurant-guide-2026. This is the standard format for readable URLs, and search engines handle hyphens as word separators while underscores are treated as joining characters, which is why hyphens are the correct choice for web addresses.

Privacy

Every conversion is a string operation performed in your browser. Nothing is uploaded, nothing is logged, and the text is gone when you close the tab. That matters when the text you are reformatting is a draft contract, an unpublished announcement or internal documentation.

Frequently asked questions

What is the difference between title case and capitalising every word?

Title case lowercases short function words — articles, conjunctions and short prepositions — unless they are the first or last word. "The Rise and Fall of the Roman Empire" is title case; "The Rise And Fall Of The Roman Empire" is naive capitalisation, and no editor would accept it. This tool does the former and offers the latter separately as "Capitalise Each Word".

Why does sentence case lowercase names like London?

Sentence case works by lowercasing everything and then re-capitalising sentence starts. Distinguishing a proper noun from an ordinary word requires understanding the text, which a string operation cannot do. Being predictable is safer than guessing wrong — capitalise names by hand afterwards.

Can I convert camelCase to snake_case and back?

Yes, in either direction and any number of times. All the code cases share a tokeniser that splits at case boundaries as well as at separators, so no information is lost converting between conventions.

Does the converter handle accented characters and other alphabets?

Upper, lower, title and sentence case use Unicode-aware matching, so accented Latin, Greek and Cyrillic text converts correctly. The code cases deliberately strip accents and non-ASCII characters, because identifiers and URL slugs need to be ASCII-safe.

Should a URL slug use hyphens or underscores?

Hyphens. Google treats a hyphen as a word separator and an underscore as a word joiner, so blue-widgets is read as two words while blue_widgets is read as one. The slug button uses hyphens for that reason.

Is my text sent to a server?

No. All conversions are JavaScript string operations running in your browser. The page makes no network requests while you use it, and your text is discarded when you close the tab.