A keyboard turns each keypress into a code your computer translates using the active layout. Here is how that works, and how keyboards differ by layout, size, switch, and connection.
A computer keyboard is an input device that turns each keypress into a code and sends it to the computer, which then turns that code into a letter, number, or command based on the layout you have selected. The keys look the same on almost every keyboard. What actually separates one from another is four things: the layout, the size, the switches under the keys, and how it connects.
This guide walks through how a keypress becomes a character on screen, then covers each of those four differences, so you can tell what matters before buying one.
What Is a Computer Keyboard?
A keyboard is an input device that converts keypresses into codes for the computer. The computer, not the keyboard, decides which character each code produces.
Keyboards inherited their key arrangement from typewriters, but they work in a completely different way. A typewriter swings a metal arm to strike paper. A keyboard only sends a signal; the character you see is decided entirely in software.
That distinction explains something that surprises a lot of people: the same physical keyboard can type different letters when you change the input language on your computer.
How a Keyboard Works
Underneath the keycaps, every keyboard does the same four things.
flowchart LR
A["Key pressed"] --> B["Switch closes a circuit<br/>in the key matrix"]
B --> C["Controller scans the matrix<br/>and detects the key"]
C --> D["Scancode sent to the computer<br/>(USB HID or Bluetooth)"]
D --> E["OS maps the scancode<br/>using the active layout"]
E --> F["Character appears on screen"]
style A fill:#f0f4ff,stroke:#4f6ef7
style F fill:#f0f4ff,stroke:#4f6ef7From keypress to character on screen.
1. The switch closes a circuit. Each key sits on a switch. Pressing it connects two traces on the circuit board. On cheap keyboards, that “switch” is just a rubber dome pushing two layers of conductive plastic together.
2. The controller scans the matrix. Keys are not wired individually. They sit on a grid of rows and columns called the key matrix, and a small microcontroller checks that grid hundreds to thousands of times per second to find which points are connected.
3. A scancode goes to the computer. The controller does not send letters. It sends a code for the key’s position, called a scancode, over USB HID (for wired keyboards and USB receivers) or over Bluetooth.
4. The operating system translates it. Windows, macOS, or Linux turns that scancode into a character using the active layout. That is why the same key produces “Q” on a US layout and “A” on a French one.
Keyboard Types by Layout
The layout decides which letter sits where. Two different things get mixed up here: the order of the letters and the physical shape of the keys.
Letter Arrangement
| Layout | Where it is used | What sets it apart |
|---|---|---|
| QWERTY | Most of the world | The top row starts Q-W-E-R-T-Y |
| AZERTY | France, Belgium | A and Q swapped, Z and W swapped |
| QWERTZ | Germany, Austria, Central Europe | Y and Z swapped |
| Dvorak | People who switch for comfort | All vowels on the left-hand home row |
| Colemak | People who want efficiency without starting over | Moves 17 keys; Ctrl+C/V shortcuts stay put |
QWERTY comes from the Sholes and Glidden typewriter of the 1870s. Its odd order is often credited to reducing jammed typebars, though historians still debate how much that mattered. What is certain is that it survived because everyone learned it, not because it is the most efficient arrangement.
Physical Shape: ANSI and ISO
Two QWERTY keyboards can still have differently shaped keys:
- ANSI (US standard): a wide, horizontal Enter key and a long left Shift.
- ISO (European standard): a tall, inverted-L Enter key and a shorter left Shift with an extra key beside it.
This matters most when you buy replacement keycaps. An ANSI keycap set will not fully fit an ISO board, and the reverse is also true.
Keyboard Types by Size
Keyboard sizes are usually described as a percentage of a full-size board. The smaller it gets, the more functions move behind a Fn key combination.
| Size | Approx. keys | What is removed | Good for |
|---|---|---|---|
| Full size (100%) | 104 (ANSI) / 105 (ISO) | Nothing | Number-heavy work: accounting, data entry |
| 96% / 1800 | about 98–100 | Gaps between clusters | Numpad needed on a smaller desk |
| TKL (80%) | 87 | Numpad | General work and gaming; mouse sits closer to center |
| 75% | about 84 | Numpad; navigation compressed | Developers who still want the F-row |
| 65% | about 68 | F-row | Small desks, arrow keys kept |
| 60% | about 61 | F-row, arrows, navigation | Portable, minimal setups |
| Split / ergonomic | varies | Depends on model | Long typing sessions, sore wrists |
The right size depends on your work, not on what is trending. If most of your day is spreadsheets, a full-size or 96% board saves you constant Fn combinations. If you write code and live in shortcuts, 75% keeps the F-row without the width.
Keyboard Types by Switch
The switch under each key decides how typing feels, how loud it is, and how long the keyboard lasts.
| Type | How it works | Feel | Sound | Lifespan | Price |
|---|---|---|---|---|---|
| Membrane / rubber dome | Rubber dome presses two conductive layers | Soft, less precise | Quiet | Shortest | Cheapest |
| Scissor | Membrane with a scissor-shaped stabilizer | Short and stable | Quiet | Medium | Low |
| Mechanical | Individual switch with a spring and metal contacts | Crisp and consistent | Depends on type | Tens of millions of presses | Mid-range |
| Optical | Press interrupts a light beam; no metal contact | Like mechanical | Depends on type | Very long | Mid to high |
| Magnetic (Hall effect) | Sensor measures magnet distance | Adjustable actuation point | Depends on type | Very long | High |
| Capacitive (Topre) | Rubber dome and spring, read by capacitance | Smooth, muted “thock” | Quiet | Very long | High |
Mechanical switches come in three feels:
- Linear: smooth all the way down, no bump. Popular for gaming.
- Tactile: a gentle bump when the key actuates, no click. A common choice for typing and coding.
- Clicky: a bump plus an audible click. Satisfying alone, distracting in a shared office.
Membrane vs Mechanical Keyboards
This is the question most people ask the first time they look at a more expensive keyboard.
| Membrane | Mechanical | |
|---|---|---|
| Construction | One rubber sheet for every key | A separate switch per key |
| Key feel | Mushy at the bottom; hard to tell when a key registers | The same from the first key to the last |
| Repair | One dead key often means a new keyboard | Switches can be replaced, without soldering on hot-swap boards |
| Noise | Quiet | Louder, depending on the switch |
| Price | Very cheap | Starts at roughly the price of a nice membrane board |
If you type for more than a few hours a day, you will feel the difference within the first week. If the keyboard only sees occasional use, a good membrane board is enough.
Keyboard Types by Connection
| Connection | Latency | Strengths | Trade-offs |
|---|---|---|---|
| Wired USB | Lowest | No battery, no lag | A cable on your desk |
| 2.4 GHz wireless | On par with wired on modern boards | Clean desk, responsive | Needs a USB receiver and charging |
| Bluetooth | Higher | No receiver; switches between several devices | Can lag briefly when waking from sleep |
Many keyboards now offer all three. That combination is the most practical if you move between a laptop, a desktop, and a tablet.
How to Choose a Keyboard Today
A sensible order of decisions:
- Size. Decide whether you need a numpad and an F-row first. It narrows the field more than anything else.
- Switch type. Membrane for light use, mechanical for long typing sessions.
- Hot-swap. On a mechanical board, swappable switches let the keyboard outlast your preferences.
- Connection. Wired if it never moves, multi-mode if you switch devices often.
- Physical layout. Match ANSI or ISO to the keycaps that are easy to buy where you live.
If you share an office, choose linear or tactile switches over clicky ones. Your colleagues will notice the difference before you do.
Frequently Asked Questions
Why are QWERTY letters not in alphabetical order? The arrangement comes from 19th-century typewriters. The most common explanation is that it reduced jammed typebars, although the exact reasoning is still debated. It stuck because people learned it, not because it is the most efficient.
Is switching to Dvorak or Colemak worth it? For some people, yes, especially heavy typists with sore hands. Expect weeks of adjustment, and you will still meet QWERTY on everyone else’s computer.
What is a hot-swap keyboard? A mechanical keyboard whose switches can be pulled out and replaced without soldering. Useful when one switch fails or when you want to try a different feel.
Why does a key type the wrong character? Almost always because the operating system’s input language changed, often through an accidental shortcut. Check your keyboard language settings before blaming the hardware.
What does “TKL” mean? Tenkeyless: a keyboard without the numeric keypad on the right, usually 87 keys.
Conclusion
The many types of computer keyboards all do the same job: turn a keypress into a code and let the operating system do the rest. Where they differ is layout, size, switch, and connection, and those four choices decide whether a keyboard fits your hands, your desk, and your work.
Want to understand the other device on your desk? Read computer mouse parts and their functions .