Keyboard: What's the Most Efficient Layout for Numbers?

By Xah Lee. Date: . Last updated: .

What's the most efficient keyboard layout for numbers?

lenovo thinkpad keyboard 2017 01 14
ThinkPad USB Keyboard, 2017. ThinkPad keyboard

Typical layout for numbers are arranged like this:

1 2 3 4 5   6 7 8 9 0

For the left hand, the 3 and 4 keys are most easy to type, and for right hand, it's 8 and 9. They are typed by your middle finger and index finger.

But, these numbers are not the most frequently used numbers.

Here's a frequency list.

inverted number row frequency
Computer Languages Characters Frequency

So, 0, 1, 2 are far more used.

The optimal arrangement is to place most frequently used digits on most easy-to-type keys. Assuming right hand is better, and middle finger better than index finger for reach. It would be something like this:

# efficient number arrangement
. . 1 3 .    . 2 0 . .

this would require changing 7 keys.

If we ignore 0, then it would be like this:

# efficient number arrangement, ignoring 0
. . 2 4 .    . 3 1 . .

this would require changing 6 keys.

To change to these new layout, would be a lot disruption of muscle memory, because some 6 key positions are changed. Also, the above layout did not consider bigram in numbers. It is my guess that the sequence 12 occurs more often than most other 2-digits sequence.

Suppose we just put 1 and 2 on the most easy-to-press spots. We do this by swapping 8 and 1, 7 and 2. We have:

# efficient layout, only 4 position changes
8 7 3 4 5    6 2 1 9 0

In this arrangement, 3 and 4 stays the same place, and 1 and 2 are moved to the most easy-to-press spots.

This simple swapping seems to achieve some 90% of optimization with minimum habit disruption.

Original Dvorak Numbers Arrangement

dvorak typewriter keyboard layout 80407
The original Dvorak typewriter keyboard layout.

Note that the original Dvorak layout, has numbers arranged like this:

# original dvorak layout
! 7 5 3 1    9 0 2 4 6 8

Note that it began with !, for the left hand pinky.

This is not bad, but optimal, because the second most frequently used key 1 now needs reach.

Now if we shift the row the left by 1 key, we have

# original dvorak layout, shifted to the left by 1 key
7 5 3 1 9    0 2 4 6 8

this is worse, because now the most frequently used key 0 now needs reach.

Most Optimal Numbers Arrangement

Here's perhaps the most optimal, strictly based on number frequency mapping to finger ease, assuming midde finger is better than index finger.

9 7 1 3 5  4 2 0 6 8

Here's a variation:

8 9 2 3 4  5 1 0 6 67

Should the Symbols Position Also Change?

Should the Shifted symbols keys also change with it?

No

Looking at the key statistics diagram above, the answer is no.

If you consider the 4 most used shifted symbols on the number row:

You see that they are already in a optimal position, pressed by your index finger or middle finger.

So, if you gonna change number keys, the shifted symbols should not change.

Significance of Keys 1 2 3 4 for Chinese Pinyin Input

The number keys are very frequently used if you input Chinese, almost every 5 keystrokes you have to press a number key.

Because, with Chinese pinyin input, you need to pick character choices 1 2 3 4, just about every character you type or every phrase. (technically, you have to press those number keys for every character. But due to phrase guessing, typically you have to press those number keys every ~3 characters.)

In fact, it is due to typing Chinese for a few months, my left hand starting to feel strained. Typically, it's impossible to change the key used for the Chinese input system. (for example, if you are using Google Pinyin in a browser.) So, the only solution is to actually change your layout.

〔►see Pinyin Letter Frequency and Keyboard Layout 拼音字母頻率 鍵盤佈局

How to Change the Number Layout?

To swap them in Linux, you can do this:

! ~/.Xmodmap
! 2015-06-15
! change number layout, but not the shifted symbols

! swap keys 8 and 1
keycode  17 = 1 asterisk 1 asterisk
keycode  10 = 8 exclam 8 exclam

! swap keys 7 and 2
keycode  11 = 7 at 7 at
keycode  16 = 2 ampersand 2 ampersand

For detail, see: Linux: xmodmap Tutorial.

For {Mac OS X, Microsoft Windows}, see: Keyboard Shortcut and Layout Tutorial.