camelCase vs snake_case: Which Is Faster to Type? We Counted the Keystrokes

The short answer: camelCase is faster to type. We took 3,026 real multi-word names from 1,350 code snippets and counted the key presses to type each one in every style. snake_case needed 10% more presses than camelCase and twice the pinky presses, because every underscore is Shift plus a stretch to the minus key. Readability research is a closer call, and in practice your language's convention should decide.
Key Findings
- •
snake_case costs 10.0% more key presses than camelCase for the same 3,026 names: 12.53 per name against 11.39.
- •
Underscores double pinky work. 2.29 pinky presses per name in snake_case, 1.14 in camelCase.
- •
kebab-case ties camelCase on presses, but only CSS, HTML and a few languages allow hyphens in names.
- •
Names are 15.6% of everything typed in our sample, so a whole snake_case codebase costs about 1.4% more key presses overall.
- •
Languages split cleanly: JavaScript is 84% camelCase, C 78% snake_case, Rust 75% and Python 70%. PHP is the only real mix.
Source: TurboType analysis of 3,026 multi-word identifiers from 1,350 code snippets in nine languages, October 2026.
1. Which Is Faster to Type: camelCase or snake_case?
Arguments about naming style usually stay in the abstract. We wanted a number. We pulled every multi-word identifier out of 1,350 snippets in our practice library, 3,026 names averaging 2.14 words each, and counted what it takes to type each one in four styles. A key press is one key going down, so Shift counts as a press.
| Style | Example | Presses per name | vs camelCase | Pinky presses per name |
|---|---|---|---|---|
camelCase | userName | 11.39 | +0.0% | 1.14 |
kebab-case | user-name | 11.39 | +0.0% | 1.14 |
PascalCase | UserName | 12.39 | +8.8% | 2.14 |
snake_case | user_name | 12.53 | +10.0% | 2.29 |
camelCase wins on both measures. The difference in total presses looks modest because the letters are identical in every style; only the separators change. Look at the separators alone and snake_case costs exactly twice as much.
2. Why the Underscore Costs So Much
A camelCase hump is one extra press: hold Shift and type the next letter, which you were going to type anyway. An underscore is two presses, Shift and the minus key, and both are pinky jobs. If you shift with the left hand, which is the right technique for a right-hand key, you use both pinkies for one character.
The minus key also sits at the far right of the number row, the longest reach a right pinky makes on a standard keyboard. Python and Rust programmers make that reach every time they type a name like max_retry_count.
Here is that one name in each style. The 13 letters are the same every time; only the two word breaks differ.
| Style | Name | Presses | Of which pinky |
|---|---|---|---|
| camelCase | maxRetryCount | 15 | 2 |
| kebab-case | max-retry-count | 15 | 2 |
| PascalCase | MaxRetryCount | 16 | 3 |
| snake_case | max_retry_count | 17 | 4 |
This is part of a wider pattern: the pinkies already do more than a third of all key presses in code, as our keystroke analysis shows, and snake_case adds to that load.
3. Does 10% Matter?
Less than the headline suggests. Multi-word names are 15.6% of the non-space characters in our sample. Writing all of them in snake_case instead of camelCase adds about 1.4% to the total number of key presses in a codebase.
It is not spread evenly. The underscore appears 15.7 times per 1,000 characters in our Python snippets, 14.0 in C and 9.9 in Rust, against 0.7 in JavaScript and 0.2 in Java. If you write Python, C or Rust, it is one of your most-typed symbols; in JavaScript you rarely touch it.
Autocomplete shrinks it further. You type a name in full once, when you declare it; after that your editor usually finishes it for you. Where the cost shows up is in new code, quick scripts and REPL sessions, where you type names out by hand, and in the pinky, which takes the extra work whether or not your speed changes.
4. Which Is Easier to Read?
Typing is only half the question. Code is read far more often than it is written, and here the research is genuinely mixed.
- •
A 2009 study by Binkley and colleagues at the International Conference on Program Comprehension reported an accuracy advantage for camelCase.
- •
A 2010 eye-tracking study by Sharif and Maletic found no difference in accuracy, but programmers recognised underscore-style names more quickly. Most of its participants had been trained in the underscore style.
- •
A later journal paper by the same group, pooling five studies and 150 participants, concluded that experienced developers are barely affected by identifier style, while beginners did better with camelCase on accuracy and effort.
The fair reading: style matters most for beginners, and familiarity matters more than either style. A Python developer reads snake_case fastest because that is what they read all day.
5. What Each Language Expects
Most languages settled this long ago. Here is what each one's official or dominant style guide says:
| Language | Variables and functions | Types and classes | Source |
|---|---|---|---|
| Python | snake_case | PascalCase (CapWords) | PEP 8 |
| Java | camelCase | PascalCase | Oracle code conventions |
| JavaScript, TypeScript | camelCase | PascalCase | Common style guides |
| C# | camelCase locals, PascalCase methods | PascalCase | Microsoft naming guidelines |
| Go | mixedCaps | MixedCaps | Effective Go |
| Rust | snake_case | UpperCamelCase | Rust API guidelines |
| PHP | camelCase methods (PSR-1) | PascalCase | PSR-1 |
| C | No official rule; snake_case is common | No official rule | Community practice |
| CSS | kebab-case | n/a | Language syntax |
And here is what the names in our snippets actually use:
| Language | camelCase | snake_case | PascalCase | SCREAMING_SNAKE | Names |
|---|---|---|---|---|---|
| C | 0% | 78% | 0% | 21% | 249 |
| C++ | 18% | 68% | 14% | 0% | 278 |
| Java | 57% | 0% | 42% | 1% | 550 |
| JavaScript | 84% | 1% | 15% | 1% | 336 |
| PHP | 39% | 32% | 20% | 8% | 483 |
| Python | 5% | 70% | 25% | 0% | 255 |
| Rust | 0% | 75% | 19% | 5% | 272 |
| TypeScript | 60% | 2% | 37% | 2% | 384 |
The conventions hold up. JavaScript is 84% camelCase, Python 70% snake_case, Rust 75% snake_case. PascalCase is large in Java, TypeScript and Python because class and type names use it. PHP is the one genuine mix: 39% camelCase, 32% snake_case.
6. What About kebab-case, PascalCase and Constants?
kebab-case (user-name) ties camelCase at 11.39 presses per name: one hyphen per break and no Shift. It would be the cheapest style of all, but most languages read a hyphen as minus, so it is limited to CSS, HTML attributes, URLs and Lisp-family languages.
PascalCase (UserName) costs one Shift more than camelCase per name, 12.39 presses. You will mostly type it for class and type names, where every mainstream convention asks for it anyway.
SCREAMING_SNAKE_CASE (MAX_RETRY_COUNT) is the convention for constants in most languages. It made up 122 of our names, mostly in C, where macros put it at 21% of all multi-word names. It is the most expensive style to type: every letter needs Shift, or you toggle Caps Lock on and off. And Caps Lock does not help with the separators, because it only affects letters. Every underscore still needs Shift and the minus key.
7. What to Do
- •
Follow your language. A codebase that mixes styles costs more in reading time than any style costs in typing.
- •
Shift with the opposite hand. For an underscore, hold left Shift and press minus with the right pinky. It splits the work between both hands instead of contorting one.
- •
Let autocomplete type long names. Declare once, then tab-complete.
- •
Practise the reach. If you write Python or Rust, the underscore is one of your most-typed symbols. Our Python and Rust tracks drill it on real code.
8. Method
We extracted every identifier from 1,350 snippets across nine language tracks and kept the 3,026 with more than one word: camelCase, PascalCase, snake_case and SCREAMING_SNAKE_CASE names, plus kebab-case names from HTML and CSS. Each name was split into words and rewritten in every style. Presses count every key: letters, separators and Shift. An underscore is Shift plus minus, a camelCase hump is Shift, a hyphen is one press. Pinky presses assume touch typing on a US keyboard, with Shift on the opposite hand. Names with runs of capitals, such as parseHTTPResponse, were left out because there is no single correct way to split them. Readability findings come from the published studies linked above; we did not measure reading.
9. Frequently Asked Questions
Is camelCase or snake_case faster to type?
camelCase. Typing the same 3,026 real identifier names, snake_case took 12.53 key presses per name against 11.39 for camelCase, 10% more. Each underscore needs Shift plus the minus key, while each camelCase hump needs only Shift.
Is snake_case easier to read than camelCase?
The research is mixed. A 2010 eye-tracking study found programmers recognised snake_case names faster with no difference in accuracy. A later journal paper pooling five studies with 150 participants found experienced developers were barely affected by style, while beginners did better with camelCase.
Why does Python use snake_case?
Because Python's official style guide, PEP 8, asks for it: lowercase words joined by underscores for functions and variables, CapWords for classes, and capitals with underscores for constants.
Which languages use camelCase?
Java, JavaScript and TypeScript use camelCase for variables and functions. C# uses it for local variables and parameters, Go uses mixedCaps, and PHP's PSR-1 standard uses it for method names.
Should I use camelCase or snake_case?
Use whatever your language and codebase already use. Consistency matters more than the typing difference, which across a whole codebase comes to about 1.4% of all key presses.
Next Steps:
- Check your codebase's style guide and stick to it.
- Try the opposite-hand Shift on your next ten underscores.
- Take the 60-second coding typing test in Python or Rust and notice how often the underscore slows you down.
