Why Your Keyboard Looks Like This: The Story Behind QWERTY

The QWERTY keyboard, named after six letters, was not born from linguistic theory or ergonomics. It was not designed for efficiency or ease, but to survive. QWERTY's roots lie in Physics, Mathematics, and Engineering.
In the world of typewriters, every keystroke triggered a levered arm swinging toward a shared metal ring. If two arms were to strike too quickly, it would lead to a collision, and hence a mechanical deadlock that engineers called a "jam".
Christopher Latham Sholes, a newspaper publisher and politician, treated each typebar jam as an experiment. After hundreds of iterations and many trade-offs, he co-invented the QWERTY layout to reduce collisions.
In practice, the 'QWERTY meaning' is simple: reliability and survival over comfort and speed.
This is the story of how mechanics, economics, and human behavior combined to produce a system that we use every single day. The compromises made over 150 years ago still govern every keystroke we make, whether it is on a physical keyboard or the taps on our smartphone screens.
The Algorithm of Survival

In the typewriters of the 19th century, every keystroke was a small act of physics: a metal arm (called the typebar) swung upward to strike an inked ribbon. Forty-two such arms sprang out from a semicircular type basket, all sharing a single narrow path toward the printing point. When two neighboring typebars were activated in quick succession, their trajectories intersected, locking the machine in a tangle.
For Sholes, the challenge here was clear: reduce collisions without rebuilding the entire mechanism. Each pair of letters (called a digram, meaning a common two-letter sequence such as TH or HE) had a measurable collision frequency. Letters that jammed the most often had to be placed farther apart around the arc of the typebasket.
While Sholes lacked formal training in mathematics or physics, we can now describe his method with modern formalism. The jam rate J resembles a pairwise potential model, where frequently co-occurring letters exhibit a repulsion-like interaction that pushes their typebars apart.
Variables:
- → fij is the frequency of digram ij
- → dij is the angular distance between the typebars of i and j
- → g(d) is a decreasing function of distance
Sholes never wrote this equation, but he performed it experimentally, i.e., move a letter, count the jams, repeat. QWERTY began as a physical algorithm for reliability, an emergent equilibrium between probability, geometry, and hardware constraints.
“QWERTY began as a physical algorithm for reliability, an emergent equilibrium between probability, geometry, and hardware constraints.”
The Rigorous Experiment

From Alphabetical to Scattered: Breaking the intuitive A-Z pattern to prevent common letter pairs from jamming
Early prototypes resembled small pianos with two horizontal rows of alphabetically arranged keys. Frequent diagrams such as TH, HE, ER, AN, and ST repeatedly collided, halting the carriage.
Sholes' letters to his partner James Densmore (1868–1873) describe hours spent in cataloging these collisions.
These letters, according to the Wisconsin Historical Society Archives, include partial layouts and notes on specific key jams, such as E and R. Densmore's feedback paved the way for readjustments and further testing.
The typebars in these prototypes pivoted radially, and adjacent arms shared axes; thus, proximity had a direct impact on collision probability.
According to his correspondence with Densmore, Sholes spent days recording how often the typebars got locked. He swapped letter positions and timed the delays between keystrokes.
Even the failures in the process were important data points as they gave useful information about the placement of keys. Sholes was essentially minimizing the probability of jams with the help of the function:
“Even the failures in the process were important data points as they gave useful information about the placement of keys.”
Through these cycles, the QWERTY layout became an emergent data-driven system. However, even with careful rearrangement, collisions could not be fully eliminated, and this constraint continued to guide later design decisions.

Layout Comparator
Compare QWERTY with an alphabetical layout to understand the trade-offs Sholes made.
Alphabetical Layout
Early typewriters used alphabetical order—intuitive but prone to jams. Adjacent letters like S-T or H-I appeared together frequently in English text.
The Jamming Problem
When typebars for adjacent letters were physically next to each other, typing common sequences like “THE” caused constant collisions and mechanical lockups.
QWERTY's Solution
Sholes scattered common letter pairs across the keyboard. T and H are separated, reducing collision probability despite increased finger travel.
Try it: Switch between layouts to see how QWERTY spreads out the letters “THE”. Notice the trade-off between intuitive layout and mechanical reliability!
QWERTY spreads common letters apart to reduce mechanical jams. Letters like T-H are separated across the keyboard.
Engineering for Failure

Vowels Shifted Up: Moving A, E, I, O, U, Y to the upper row to distribute frequent keystrokes across the basket
Around forty-two typebars pivoted within a semi-circular typebasket, each traveling roughly 30–45°. A typebar, on striking the ribbon, recoiled under the tension of the return spring. When a key was released, the bar did not reset instantly. Instead, the spring's tension caused a brief oscillation.
During this small window, the arm interfered with the typebar, occupying the same path. If an adjacent key was pressed too soon, the trajectories had a higher probability of overlapping, thus causing the jams. Although the timing was not long (less than a second), it was enough for quick operators to trigger a jam, particularly when typing diagrams such as TH or HE.
As letters frequently used together posed the greatest risk of collision, Sholes started placing them farther apart in the typebasket.
The adjacency problem scales roughly as O(n²), because every pair of typebars is a possible interaction that could lead to a jam.
“The adjacency problem scales roughly as O(n²), because every pair of typebars is a possible interaction that could lead to a jam.”
For example, to reduce stress on the mechanism, vowels were shifted to the upper row. This design choice distributed frequent keystrokes across the basket, but at the expense of optimal hand ergonomics.
Historical reconstructions of typebar dynamics and Remington manuals confirm these constraints, showing that collision probability, angular separation, and spring mechanics dictated early keyboard layout.
Beyond mechanics, the design of QWERTY was also shaped by material cost and manufacturing constraints – the next layer of its survival logic.
0 & 1: The Economics of Absence

Removed 0 and 1: Substituted with O and I to reduce mechanical complexity and jam frequency by ~5%
Each additional key required a typebar and spring, increasing collision points and maintenance complexity. Omitting two keys would simplify the typebasket and lower the probability of mechanical failure.
"0" and "1" were the easiest to replace (with O and I). Other letters or numbers did not have such intuitive substitutes. Operators quickly adapted to this omission. Typewriter manuals explicitly taught a workaround where "0" was replaced with uppercase O, and "1" was replaced with uppercase I or lowercase l.
“Fewer typebars reduced friction by roughly 2% and jam frequency was reduced by approximately 5%.”
These omissions influenced the keyboard layout itself. The layout of the keyboard shows traces of this substitution practice, where 0 is close to O.
Morse and the Telegraph Operators

Final QWERTY Layout: Optimized for telegraph operator muscle memory, placing frequent letters centrally and rare ones on periphery
Telegraph operators had developed their own habits: sequences of dots and dashes were executed precisely, with the most common letters typed more frequently and numerically-coded messages following specific patterns. Operators relied on muscle memory and precise timing, forming informal conventions to maximize speed and minimize errors.
Remington engineers observed these behaviors, experimenting with layouts to map these high-frequency patterns onto the typewriter.
Frequency-informed adjustments thus became central to the QWERTY layout. Common letters in English were moved toward central, easily accessible keys. Rare letters were pushed to the periphery.
“Frequency-informed adjustments thus became central to the QWERTY layout. Common letters in English were moved toward central, easily accessible keys.”
Error mitigation was another driver. Letters frequently confused in Morse, such as Z (− − · ·) versus the digram SE (· · · / ·), were intentionally separated, reducing mis-strikes.
Ultimately, QWERTY balanced mechanical limits and operator habits into a single layout.
Digram Math: The Hidden Graph

Optimized Letter Pairs: Common digrams like TH and HE separated widely, while some pairs like ER remained adjacent due to engineering constraints
Letters that jammed most frequently, such as TH or HE, were found to be placed deliberately far apart in the basket. Yet the layout was not mathematically perfect. Pairs like ER, though common, remained neighbors, revealing that practical engineering constraints sometimes overrode ideal separation.
From this data emerges a typebasket behaving like an implicit optimization graph: letters as nodes, their mechanical proximities as edges, and jam probability as weighted connections. Through repeated trial, error, and iteration, Sholes effectively minimized this function across all digrams:
“A typebasket behaving like an implicit optimization graph: letters as nodes, their mechanical proximities as edges, and jam probability as weighted connections.”
This solution to a constrained optimization problem made QWERTY a mechanical graph encoding both physics and probability.
QWERTY, therefore, was not an arbitrary invention, but an early case of constrained optimization. It served as a mechanical graph encoding both physics and probability, and providing a framework for human hands to adapt.

Digram Analyzer
Analyze letter pairs (digrams) in any text and see how QWERTY handles them.
What Are Digrams?
Digrams are two-letter sequences. In English, “TH”, “HE”, “IN”, and “ER” are the most common. These frequent pairs were Sholes' primary optimization target.
Same Hand Problem
When both letters of a digram are typed by the same hand (left or right), it increases jamming risk on mechanical typewriters since typebars on the same side are physically closer.
QWERTY's Strategy
QWERTY strategically places common digrams across different hands. “TH” has T (left) and H (right), reducing mechanical collision probability.
Try it: Paste different text samples—emails, articles, code. Watch how digram frequencies change and notice which pairs would have caused typewriter jams!
Top 10 Digrams
Blue bars = letters on opposite hands (less jamming). Pink bars = same hand (potential collisions).

QWERTY is still around, not because it is the easiest to use or it is perfect, but because it is good enough to survive. It's a fossil of nineteenth-century physics, embedded in twenty-first-century software.
Each key carries the inertia of trial and error, of springs and levers, of human adaptation to mechanical rhythm. The typewriter's constraints have long vanished, yet their presence can be felt in every interface we touch.
The physics that once governed typebars now governs thumbs and touchscreens. The optimization problem that Sholes solved in the 1870s persists in the palm of our hands.
Systems survive not by being the best, but by being the most compatible with what already exists. QWERTY proves that efficiency can be adapted by humans and turned into a habit, that human muscle memory can outlast any machine, and that the legacy of smart engineering solutions can shape lives long after the hardware is gone.
Sources
David, P. A. (1985). Clio and the economics of QWERTY. American Economic Review, 75(2), 332–337.
First Practical Typewriter. (2012, October 19). Wisconsin Historical Society.
Harrison, J. (1890). A manual of the Remington standard typewriter. United Kingdom: (n.p.).
KAZ: News, reviews, posts, and upcoming events. (2019). Kaz-Type.com.
Lewand, R. E. (2000). Cryptological Mathematics. Mathematical Association of America.
Mike. (2016, May 15). The Story of James Densmore and the First Typewriter.
Norvig, P. (2012, December 17). English letter frequency counts: Mayzner revisited.
Scientific American. (1872, August 10). The new typewriter and its mechanism.
Yamada, H. (1981). A historical study of typewriters and typing methods.
Yasuoka, K., & Yasuoka, M. (2011). On the Prehistory of QWERTY. Zinbun, 42, 161-174.

Learn more
Explore more about how Greptile works