Two kinds of conversion
The buttons above do two quite different jobs. The first group — UPPERCASE, lowercase, Title Case, Sentence case and tOGGLE cASE — changes the capitalisation of letters and leaves punctuation, spacing and line breaks exactly where they were. The second group — camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case and dot.case — first splits the text into words and then glues them back together as a single identifier. Spaces, underscores, hyphens, dots, slashes and any other non-letter, non-digit characters are all treated as word boundaries. That is why "user profile image URL" becomes userProfileImageUrl in camelCase and why feeding that result back in as kebab-case gives user-profile-image-url: the starting notation does not matter, only the words it contains.
How word boundaries are found
The quality of any identifier conversion depends on where the words are split. This converter applies three rules in order.
- A capital letter that directly follows a lowercase letter or a digit starts a new word (userName becomes user Name; getUserID becomes get User ID).
- In a run of capitals followed by a capital-plus-lowercase pair, the split goes before the last capital (HTMLParser becomes HTML Parser; XMLHttpRequest becomes XML Http Request).
- Everything that is not a letter or digit — spaces, underscores, hyphens, dots, brackets, slashes — is a separator and is dropped.
The second rule is what keeps acronyms intact instead of shredding them letter by letter. The table below was produced by running the actual conversion functions on the samples, so each row starts from the same word list and you can compare across the columns.
| Input | camelCase | PascalCase | snake_case | CONSTANT_CASE | kebab-case | dot.case |
|---|---|---|---|---|---|---|
| user profile image URL | userProfileImageUrl | UserProfileImageUrl | user_profile_image_url | USER_PROFILE_IMAGE_URL | user-profile-image-url | user.profile.image.url |
| HTMLParser | htmlParser | HtmlParser | html_parser | HTML_PARSER | html-parser | html.parser |
| getUserID2 | getUserId2 | GetUserId2 | get_user_id2 | GET_USER_ID2 | get-user-id2 | get.user.id2 |
| order-total_price | orderTotalPrice | OrderTotalPrice | order_total_price | ORDER_TOTAL_PRICE | order-total-price | order.total.price |
| XMLHttpRequest | xmlHttpRequest | XmlHttpRequest | xml_http_request | XML_HTTP_REQUEST | xml-http-request | xml.http.request |
As "getUserID2" shows, digits stay attached to the letters before them, so "ID2" is one chunk. If you want a break between a letter and a number, put a space there before converting. There is also a hard limit: the converter has no dictionary, so a word that is run together in lowercase, such as "newyork", cannot be split in two. A boundary needs a visible signal — a space, a separator or a change of case.
Which notation belongs where
Naming style is convention, not taste. Breaking the convention rarely stops code from running, but it earns review comments and linter warnings, and in a few environments it causes real problems.
- camelCase: variables, functions and methods in JavaScript, TypeScript, Java and Swift; also very common for JSON keys.
- PascalCase: classes, types and UI components such as React or Astro components, and method names in C#. In Go, a leading capital letter makes a name exported from its package.
- snake_case: functions and variables in Python (PEP 8) and Rust, and table and column names in many databases.
- CONSTANT_CASE (also called UPPER_SNAKE_CASE): constants and environment variables such as
DATABASE_URL. - kebab-case: URL paths, CSS classes and custom properties, HTML attributes and file names. Most programming languages cannot use hyphens in identifiers because they read the hyphen as a minus sign.
- dot.case: configuration keys such as
server.port, package or namespace paths, and log event names. - Title Case / Sentence case: headlines, menu labels, button text and ordinary prose; see the next section for the rules.
How Title Case and Sentence case actually work
Title Case capitalises the first letter of each word, but by long-standing convention articles (a, an, the), coordinating conjunctions (and, but, or) and short prepositions (of, in, on, at, to, by, for) stay lowercase. The first and last words are always capitalised. With "Keep small words lowercase" ticked, this tool lowercases the words in its list (a, an, the, and, but, or, nor, for, so, yet, of, in, on, at, to, by, up, as) except in first and last position; with it unticked, every word gets a capital. Style guides such as AP, APA, Chicago and MLA disagree on details like whether four-letter prepositions are capitalised, so no tool can match all of them. If the headline is going to a publisher or a journal, check it against their guide.
Sentence case capitalises only the first letter of each sentence and lowercases the rest. A full stop, question mark or exclamation mark followed by whitespace, or the start of a new line, begins a new sentence. The catch is that proper nouns and acronyms are lowercased too: "Paris is in FRANCE." becomes "Paris is in france." You will need to restore names such as France, NASA or iPhone by hand afterwards.
Two conversions worked through
Example 1: "user profile image URL" contains three spaces, so it splits into four words (user, profile, image, URL). In snake_case they are lowercased and joined with underscores: user_profile_image_url. In CONSTANT_CASE the same words become USER_PROFILE_IMAGE_URL.
Example 2: "HTMLParser" is split by rule 2 into "HTML" and "Parser". In snake_case that is html_parser, in kebab-case html-parser, and in camelCase htmlParser, which matches the usual convention of lowercasing a leading acronym. A naive converter that only looked for lowercase-to-uppercase transitions would have produced "htmlparser" instead.
Where Unicode casing stops being simple
It is tempting to assume that upper-casing a letter gives back exactly one letter, and that lower-casing reverses it. Outside plain English that assumption fails. This tool uses the browser's built-intoUpperCase() and toLowerCase(), which apply Unicode's default, language-neutral mapping. The rows below were computed by running those methods.
| Input | Method | Result | What is going on |
|---|---|---|---|
| straße | toUpperCase() | STRASSE | The German sharp s becomes two letters, SS, so the text gets longer. |
| final (with the fi ligature) | toUpperCase() | FINAL | The single ligature character expands to the two letters F and I. |
| İstanbul | toLowerCase() | i̇stanbul | Turkish dotted capital İ becomes i plus a combining dot above, so the result is one code unit longer than the input. |
| istanbul | toUpperCase() | ISTANBUL | Without Turkish rules the dotted i turns into a plain I; Turkish readers expect İSTANBUL. |
| ISPARTA | toLowerCase() | isparta | Without Turkish rules the capital I becomes i; Turkish expects the dotless ı (ısparta). |
| ΣΑΣ | toLowerCase() | σας | Greek capital sigma becomes ς at the end of a word and σ elsewhere, so lowercasing is context-sensitive. |
Turkish and Azerbaijani are the classic trap: they have both a dotted and a dotless i, so "I" and "i" are not each other's capital. Correct Turkish casing needs a language-aware routine such astoLocaleUpperCase('tr'), which this page does not call, so Turkish text should be checked by hand. Scripts with no case at all — Chinese, Japanese, Korean, Thai, Arabic, Hebrew, Hindi — pass through the capitalisation buttons unchanged, so mixed text only has its Latin letters altered. The identifier styles will still split such text at spaces and symbols and join the pieces, but identifiers containing non-Latin letters may be rejected by your language, tooling or team style guide, so check before using them.
Converting many lines at once
A typical job is turning a list of twenty column names into snake_case in one go. With "Convert each line separately" ticked, each line is treated as its own identifier and the line count is preserved. Unticked, the whole text is merged into a single identifier and line breaks are swallowed as separators. UPPERCASE, lowercase, Title Case, Sentence case and tOGGLE cASE always keep line breaks and punctuation as they are.
Common mistakes
- Assuming a conversion can be reversed. Turning "XMLHttpRequest" into snake_case gives "xml_http_request"; converting that back to camelCase yields "xmlHttpRequest", not the original, because the capitals of the acronym are lost. Keep the original text.
- Renaming API fields or database columns in bulk and shipping the result. Changing a JSON key or a column name affects the server, the client and every query. The rename is never just cosmetic, so check compatibility first.
- Using snake_case in URLs. Hyphens are the usual word separator in URL slugs and are what most guidance on readable URLs assumes, so kebab-case is the safe default.
- Expecting a Title Case button to fix a headline. It applies a generic rule. It does not recognise brand names such as eBay or iPhone and may disagree with the style guide you are following.
When this tool is the wrong choice
Renaming identifiers across a code base, including every place they are referenced, needs your editor's rename-symbol feature. This page changes text only and has no idea what the code means. It also does not recognise proper nouns, and it does not check grammar.
What to do next
After converting a list, you might want to count what is in it with theword counter, or compare the old and new versions line by line in the text diff checker to confirm nothing changed that should not have. If you are building patterns to find and rewrite names in bulk, theregex tester lets you try the expression on sample text first. And if the converted names are going into a JSON file, theJSON formatter will validate and tidy the result.
Frequently Asked Questions
Does this work on non-English text?
Upper and lower case only exist in some alphabets (Latin, Greek, Cyrillic, Armenian and a few more). Chinese, Japanese and Korean text passes through the capitalisation buttons unchanged. camelCase, snake_case and the other identifier styles split on spaces and symbols, so they run on any text, but they were designed for English-based code naming.
Is the text I enter saved anywhere?
No. Every conversion runs in your browser; the text is not sent to a server.
What is the difference between camelCase and PascalCase?
Both capitalise the first letter of each word and use no separator. They differ only in the first letter: camelCase starts lowercase (userName) and PascalCase starts uppercase (UserName). Many languages use camelCase for variables and functions and PascalCase for classes, types and components.
Why does HTMLParser become html_parser and not h_t_m_l_parser?
When a run of capitals is followed by a capital and a lowercase letter, the split is placed before that last capital (between L and P here). HTML is therefore kept as one word, which gives html_parser and html-parser.
How are numbers handled?
Digits stay attached to the neighbouring letters. "version2 update" becomes "version2_update" in snake_case. To separate a number from a word, insert a space in the input first.
Why did my line breaks or punctuation disappear?
That is expected for the code-style buttons, which treat every character that is not a letter or digit as a separator. Keep "Convert each line separately" ticked to preserve the line count, or use UPPERCASE, lowercase, Title Case or Sentence case to keep punctuation.