Keyboard latency: where the delay comes from and how it is tested

Keyboard latency is the time from the moment your finger starts pressing a key to the moment the keyboard has sent that press to the computer. It adds up in four places: the key's travel, the keyboard scanning its keys, debounce and USB polling. No website can measure it, because a browser only hears about a press after the keyboard has sent it. Testers use a solenoid that presses the key and a USB analyzer that records when the press leaves the keyboard. To lower it, use a shorter actuation point, the highest polling rate and the lowest debounce setting that does not make keys type twice.

Keyboard test

Where a key press waits before the computer gets it

  1. Key travelthe key moves down to the point where the switch fires
  2. Scanningthe keyboard's chip checks the grid of keys, row by row
  3. Debounceit waits for the switch contact to stop bouncing, or ignores the bounce
  4. USB pollingthe press waits until the computer next asks the keyboard for news

Together: keyboard latency

A web page can only start its clock here

Computer and screen the game uses the press, draws a frame and the display shows it: the rest of your input lag

Reviewers who measure keyboards time the first four steps: from the moment something touches the key to the moment the USB packet leaves the keyboard.

Where the delay comes from

Polling rate in milliseconds

The time between two polls is 1,000 ms divided by the polling rate. On average a press waits half of that.

Polling rate in milliseconds
Polling rateA poll everyAverage wait
125 Hz8 ms4 ms
250 Hz4 ms2 ms
500 Hz2 ms1 ms
1000 Hz1 ms0.5 ms
8000 Hz0.125 ms0.0625 ms

Going from 125 Hz to 1,000 Hz saves 3.5 ms on average. Measured keyboards differ by far more than that: in 2017 Dan Luu measured 21 keyboards at 15 to 60 ms, and the two gaming keyboards among them were not faster than the others.

How keyboard latency is tested

Why no website can test keyboard latency

A browser learns of a key press only after the keyboard has sent it and the computer has passed it on, so everything this page describes has already happened before a web page can start a clock. A test that times you from a signal to your key press measures your reaction, which takes far longer than the keyboard. What a browser can check is whether every key registers and how many work at once, on the keyboard test, and whether a key types twice, on the double press test.

How to lower keyboard latency

How linear, tactile and clicky switches differ, with the makers' figures for actuation point and force: keyboard switches.

Sources: Dan Luu, Keyboard latency; RTINGS, Keyboard latency test method; LTT Labs, How Labs conducts keyboard testing; QMK, Debounce algorithm; Wooting, How to set up Rapid Trigger; OSLTT, Open Source Latency Test Tool.