Format Code Now
/
TextCase Converter Next: SQL IN List Builder ›

Case Converter

TX-02

Paste text and pick a case: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, Sentence case, lower or UPPER. Each line is converted on its own.

Runs in your browser. Nothing is uploaded.

Text

Result

How to use it

  1. Paste your text into the input box, one name or sentence per line.
  2. Click the case you want, such as camelCase or snake_case.
  3. Tick Keep acronyms uppercase if you want userID instead of userId.
  4. Tick Keep small words lowercase to leave words such as of and the in lowercase in Title Case.
  5. Copy the result or download it as a text file.

How names are split into words

For camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE the line is first cut into words at spaces, punctuation, underscores and hyphens, at a lowercase letter followed by a capital, and where an acronym ends: HTMLParser splits into HTML and Parser. Digits stay with the letters before them, so version2Beta gives version2 and Beta. Punctuation and apostrophes are dropped, so don't becomes dont.

Acronyms and small words

Words such as ID and HTML are lowercased by default, giving userId and parseHtml, which matches most style guides. Tick Keep acronyms uppercase to get userID and parseHTML. This only applies when the line also has lowercase letters, so a line typed in all capitals is not treated as one big acronym. In Title Case you can keep small words such as a, the, of and to lowercase unless they are first or last.

Title case, sentence case and plain text

Title Case and Sentence case keep your punctuation and spacing when the line contains spaces. A line with no spaces, like some_snake_case or helloWorld, is read as a name and turned into separate words, which also drops punctuation such as the ! in Hello!. Sentence case lowercases everything and then capitalizes the first letter of the line and of each sentence, so names, acronyms and the word I are lowercased and need fixing by hand.

Questions people ask

How do I convert text to camelCase?

Paste the text and click camelCase. The first word is lowercase and each later word starts with a capital, with spaces, hyphens and underscores removed. For example, user_account name becomes userAccountName.

What is the difference between camelCase and PascalCase?

Both join words with no separator and capitalize each later word. camelCase starts with a lowercase letter, like userName, and PascalCase starts with a capital, like UserName. Which one to use depends on your language and style guide.

What is the difference between snake_case and kebab-case?

Both use lowercase words. snake_case joins them with underscores and is common in Python, Ruby and SQL column names. kebab-case joins them with hyphens and is common in URLs, CSS class names and file names.

Does it handle acronyms like HTML and ID?

Yes. HTMLParser is split into HTML and Parser, and userID into user and ID. They are lowercased by default, as in userId. Tick Keep acronyms uppercase to keep them as typed in camelCase and PascalCase.

Can I convert many lines at once?

Yes. Each line is converted separately and blank lines stay blank, so you can paste a column of field names and convert them all together. Line breaks are kept as they were.

Does Title Case follow a style guide?

Not strictly. By default every word starts with a capital and the rest is lowercased, except words that already have a capital after the first letter, such as NASA or iPhone, when the line also has lowercase text. The small words option leaves a short list, such as a, an, the, and, of, in and to, in lowercase unless they come first or last. Check names and style rules by hand.

About this tool

Each line is converted on its own. The programming styles (camel, Pascal, snake, kebab, CONSTANT) split a line into words at spaces, punctuation, underscores, hyphens, case changes and acronym ends, so HTMLParser becomes HTML and Parser, and keep digits with the letters before them. They drop all punctuation and apostrophes. Title and Sentence case keep punctuation and spacing when the line has spaces; a line with no spaces is treated as one identifier and split into words, so punctuation in a single token such as Hello! is dropped. Sentence case lowercases everything except the first letter of each sentence, so names and acronyms are lowercased. lower and UPPER use JavaScript Unicode rules, so ß becomes SS.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.