FileKiln

Case Converter

Convert text between camelCase, PascalCase, snake_case, kebab-case, Title Case, and more, all at once. Runs in your browser, nothing uploaded.

Ready when you arecase convert
Runs on your computer. Nothing gets uploaded.

Your stuff stays yours. The conversion happens in this page's JavaScript. Nothing you paste here leaves your machine, and the tool keeps working with the network unplugged.

One input, every convention at once: camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, dot.case, Title Case, Sentence case, and plain upper/lower. The converter first splits your input into words - and it understands existing conventions, so userProfileSettings, user_profile_settings, and user profile settings all produce the same word list. That means you can paste an identifier from one codebase and immediately read off the correct form for another: a Python constant, a CSS class, a JSON key, a database column. Acronym runs like parseHTMLDocument split sensibly too.

How to use the case converter

  1. Type or paste a phrase or an identifier into Text in. It can already be in any convention: spaces, underscores, hyphens, dots, or mixed capitals.
  2. Press Convert.
  3. Read the ten rows in All cases out. Each row starts with the name of the convention, then the converted text.
  4. Select the one value you need and copy it, or press Copy result to take all ten rows at once. Clear resets both boxes.

The converter treats everything in the input box as one name. If you paste several lines, they are joined into a single long identifier, so convert one name at a time.

How the input gets split into words

Every conversion is the same two-step process: break the input into a list of lowercase words, then glue those words back together with a convention's separator and capitalization rule. Understanding the first step explains almost every surprising result.

The splitter works in this order:

  1. It inserts a break wherever a lowercase letter or digit is followed by a capital letter. userId becomes user Id, and version2Beta becomes version2 Beta.
  2. It inserts a break inside a run of capitals just before the last capital when that capital is followed by a lowercase letter. HTMLDocument becomes HTML Document.
  3. It splits on every character that is not an ASCII letter (A to Z, a to z) or a digit. Spaces, underscores, hyphens, dots, slashes, and apostrophes all act as separators.
  4. It lowercases every word.

After that, the rules for each row are simple. camelCase lowercases the first word and capitalizes the first letter of the rest. PascalCase capitalizes every word. snake_case, kebab-case, and dot.case join lowercase words with _, -, and .. SCREAMING_SNAKE is snake_case in capitals. Title Case capitalizes the first letter of each word and joins with spaces. Sentence case capitalizes only the very first letter.

A worked example

Input:

parseHTMLDocument

Output after pressing Convert:

camelCase        parseHtmlDocument
PascalCase       ParseHtmlDocument
snake_case       parse_html_document
SCREAMING_SNAKE  PARSE_HTML_DOCUMENT
kebab-case       parse-html-document
dot.case         parse.html.document
Title Case       Parse Html Document
Sentence case    Parse html document
lowercase        parse html document
UPPERCASE        PARSE HTML DOCUMENT

Notice that the acronym did not survive in the camelCase and PascalCase rows: it comes back as Html, not HTML. That is a consequence of step 4 above, and it happens to match style guides that treat acronyms as ordinary words in identifiers (for example XmlHttpRequest style). If your codebase keeps acronyms in capitals, fix those letters by hand after copying.

Common problems and how to fix them

Accented letters disappear

Only ASCII letters count as word characters, so letters like é, ü, or ñ act as separators and are dropped. café au lait converts to caf_au_lait. Identifiers in most codebases are ASCII anyway, so strip the accents first. The URL slug generator does that transliteration (café becomes cafe), and you can paste its output back here.

Apostrophes split a word in two

An apostrophe is a separator, so don't stop produces don_t_stop and donTStop. Remove apostrophes before converting if you want dont_stop.

Mixed-case brand names break oddly

Names like iOS or eBay contain a lowercase-to-uppercase boundary, so the splitter sees two words: iOS becomes i_os in snake_case and IOs in PascalCase. Write the name as a single lowercase word (ios) in the input when you want it kept together.

Title Case lowercases the rest of each word

Because every word is lowercased before being capitalized, NASA launch plan becomes Nasa Launch Plan. The Title Case and Sentence case rows are designed for identifiers and labels, not for editing prose that contains proper nouns or acronyms. For headings with acronyms, adjust those words by hand.

"No letters or digits found in the input"

The input contained only punctuation, symbols, emoji, or non-Latin script, so the word list came out empty. Add at least one ASCII letter or digit, or transliterate the text first.

Related tasks

For URL paths from article titles, the slug generator handles many titles at once, one per line. To make a list of names unique before converting them, run it through remove duplicate lines.

Questions this tool gets asked

How does it split words?

On any non-alphanumeric separator (spaces, underscores, hyphens, dots) and on case boundaries inside identifiers, including acronym boundaries - parseHTMLDocument becomes parse, HTML, document.

When do I use snake_case vs camelCase vs kebab-case?

Convention follows the ecosystem: snake_case for Python and SQL, camelCase for JavaScript and Java variables, PascalCase for class names, kebab-case for URLs and CSS classes, SCREAMING_SNAKE for constants and environment variables.

Does Title Case follow style-guide rules about small words?

No - it capitalizes every word, which is what identifier and heading conversion usually wants. Editorial title case (lowercase “of”, “the”, etc.) varies by style guide and is best applied by a human who knows which guide.

What happens to numbers?

Digits stay attached to their word: version2Beta converts to version2_beta, version-2-beta splits as written. Numbers never gain or lose position.

Related tools