Case Converter for Text and Identifiers – Free

This case converter rewrites pasted text in one of seven styles, from plain upper and lower case to the camelCase, snake_case and kebab-case forms used for identifiers.

How to use the Case converter tool

  1. Pick the target under Style: UPPER CASE, lower case, Title Case, Sentence case, camelCase, snake_case or kebab-case.
  2. Paste or type the words into Text. Line breaks are kept in the first four styles.
  3. Select Convert. The Example button loads a short phrase and converts it to UPPER CASE.
  4. Check the Result box, then select Copy. Change Style and select Convert again to try another form.

What each style in the case converter does

The seven options fall into two groups. Four of them change letter case and leave spacing, punctuation and line breaks alone. The other three build a single identifier from the words they find.

  • UPPER CASE and lower case use the Unicode case mappings, so the German sharp s becomes SS in capitals.
  • Title Case capitalizes the first letter of every run of letters and lowercases the rest, including short words such as of and the.
  • Sentence case lowercases everything, then capitalizes a letter at the very start of the text and the first letter after a period, question mark or exclamation mark followed by whitespace.
  • camelCase joins the words with no separator, first word lowercase and each later word capitalized.
  • snake_case joins lowercase words with underscores.
  • kebab-case joins lowercase words with hyphens.

A worked example with all seven styles

The phrase below is the one the Example button loads. The comma and the closing punctuation survive in the first four rows and disappear in the last three, because identifier styles keep only the words.

Identifier styles also read existing identifiers. myVariableName becomes my_variable_name in snake_case, and order_item_count becomes orderItemCount in camelCase.

Text: Hello, developer tools!

UPPER CASE     HELLO, DEVELOPER TOOLS!
lower case     hello, developer tools!
Title Case     Hello, Developer Tools!
Sentence case  Hello, developer tools!
camelCase      helloDeveloperTools
snake_case     hello_developer_tools
kebab-case     hello-developer-tools

How words are split for camelCase, snake_case and kebab-case

Before joining, the tool inserts a break wherever a lowercase letter or digit is followed directly by an ASCII capital, and turns underscores into spaces. It then asks the browser's Intl.Segmenter for the word-like pieces of the text, which follows the Unicode word boundary rules. Spaces, hyphens, brackets and most punctuation fall away. Total Order Amount (USD) becomes total_order_amount_usd.

Two consequences are worth knowing. Runs of capitals are not split, so XMLHttpRequest turns into xmlhttp_request and parseHTTPResponse into parse_httpresponse. Line breaks count as ordinary gaps between words, so a multi-line list comes out as one long identifier.

Edge cases to check before you paste the result

The rules are simple pattern matches, not a grammar or a style guide, so a few inputs need a manual fix.

  • Title Case starts a new word after an apostrophe or underscore and skips leading digits: it's becomes It'S, user_id becomes User_Id and 2nd becomes 2Nd.
  • Acronyms lose their capitals: USD becomes Usd in Title Case, and fromAPI becomes from_api in snake_case.
  • Sentence case does not restore capitals for names or for the pronoun I in the middle of a sentence.
  • Apostrophes and dots inside a word stay in identifier styles: don't stays don't and v1.2 stays v1.2.
  • There is no PascalCase or CONSTANT_CASE option. Convert to camelCase or snake_case and adjust from there.

Where each naming style is used

JavaScript and Java use camelCase for variables and functions. Python, Ruby and Rust favor snake_case, as do most SQL column names. kebab-case is common in URL slugs, CSS class names, HTML attributes and command line flags.

Frequently asked questions

How do I convert camelCase to snake_case?

Paste the camelCase name into Text, choose snake_case under Style and select Convert. The tool breaks the name where a lowercase letter or digit meets a capital, so getUserId becomes get_user_id.

Does Title Case follow AP or Chicago style rules?

No. Every word starts with a capital, including the articles, conjunctions and short prepositions that style guides keep lowercase. Lower those by hand where your style guide asks for it.

What is the difference between snake_case and kebab-case?

Both write words in lowercase. snake_case joins them with underscores and is a valid identifier in most programming languages. kebab-case joins them with hyphens, which most languages read as a minus sign, so it is used in URLs, file names and CSS instead.

Does the converter handle accented and non-Latin letters?

Yes, for scripts that have letter case. café becomes CAFÉ, and Greek or Cyrillic text converts too. Scripts without case, such as Chinese or Arabic, pass through unchanged.

Related tools