Typing test math: rounding, the chart and consistency in depth

Last updated

This page picks up where how WPM and accuracy are calculated leaves off. That guide defines each number; this one works through the details behind them: how results are rounded, what one typo really costs, how the chart is built, and why the consistency curve behaves the way it does.

Precision: what is stored and what is shown

PuggieType measures time with millisecond precision, but the numbers you see go through a few rounding steps on the way to the screen. Knowing them explains most "why does it say 96 when I calculated 97?" moments.

Test duration

The test length used in every speed formula is rounded to the nearest hundredth of a second. Custom-mode tests are the exception and keep the full measured time. For a timed test the duration is simply the length you picked; for a word or quote test it is the moment you finished the last word.

25-word test, last word finished at 23.4567 s
duration used = 23.46 s
140 correct-word characters
(140 / 5) / (23.46 / 60) = 28 / 0.391 ≈ 71.61 wpm

Saved results (in your browser)

WPM, raw, accuracy and both consistency figures are saved in your browser to two decimal places. So the result above is held as 71.61, not as a long fraction.

Displayed results

By default the big numbers are shown as whole numbers, and two different rounding rules apply:

Rounding accuracy down is deliberate: it never shows you a better result than you actually got. Hover over a number on the result screen to see it with two decimals, and over accuracy to see the raw counts of correct and incorrect keypresses. If you prefer decimals everywhere, turn on always show decimal places in the settings.

Other speed units

Every speed is calculated in WPM first. If you pick a different unit in the settings, only the display changes, using these factors:

UnitConversion72 wpm becomes
cpm (characters per minute)wpm × 5360
wps (words per second)wpm ÷ 601.2
cps (characters per second)wpm × 5 ÷ 606
wph (words per hour)wpm × 604,320

Because the conversion happens after the calculation, switching units never changes how two results compare with each other.

What a single typo costs

In WPM

WPM only counts words that end up completely correct, plus the space after each. Leave one wrong letter in a six-letter word and you lose all seven characters, which in a 30-second test is:

7 / 5 = 1.4 words
1.4 / 0.5 minutes = 2.8 wpm

In a 60-second test the same mistake costs 1.4 wpm, because the loss is spread over twice the time. That is one reason short tests swing so much: a couple of uncorrected slips in a 15-second test can move WPM by more than ten.

If you fix the typo before moving on, the word counts in full and WPM only pays for the time the wrong key, the backspace and the right key took. Raw is calculated from the text you end up with, so the deleted character does not appear there either.

In accuracy

Accuracy counts every key as you press it, so each mistake is worth a fixed slice of the total. With N keypresses, one error costs 100 ÷ N percentage points. Turned around, the number of errors you can afford for a target accuracy is:

allowed errors = keypresses × (1 - target / 100)

For a test with 200 keypresses, roughly what a 30-second test at about 80 wpm produces, that gives:

Target accuracyErrors allowed out of 200
94%12
96%8
98%4
99%2

Going from 94% to 97% on that test means halving your mistakes, from 12 to 6. And because the display rounds down, 199 correct out of 200 is 99.5% but still reads 99%.

How the result chart is built

The chart below the result splits the test into one-second slices and plots up to four series: wpm, raw, burst and errors. You can switch the last three on and off in the legend. They look similar but are calculated quite differently.

The wpm and raw lines are cumulative

At each second, the wpm line shows your WPM so far: the correct-word characters typed from the start up to that point, divided by the time elapsed. It is a running total, which is why it starts jumpy and settles down as the test goes on.

second   correct-word chars so far   wpm so far
  1                6                 6 / 5 / (1/60) = 72
  2               13                 13 × 12 / 2   = 78
  3               19                 19 × 12 / 3   = 76
  4               27                 27 × 12 / 4   = 81
  5               33                 33 × 12 / 5   = 79.2 → 79

(Multiplying characters by 12 and dividing by seconds is the same as dividing by 5 and by minutes.) A mistake shows up as a flat spot or dip, because the word containing it stops contributing. The dashed raw line is built the same way, but counts all typed characters instead of only correct words, so it ends at your final raw speed.

The burst line is per second

The burst line does not accumulate. For each one-second slice it counts every character you typed in that slice, right or wrong, and converts it to a speed, rounded to a whole number. Seven characters in one second is 84; six is 72.

Two details make burst differ from raw. It counts characters at the moment you type them, including ones you later delete, while raw is calculated from the text you end up with. And it treats each second on its own, so it shows the peaks and pauses that the cumulative lines smooth away. The chart may draw burst slightly smoothed; the calculations below always use the unsmoothed values.

Errors per second

The last series is the number of wrong characters you typed in each slice. Lining it up with dips in burst usually tells you whether you slowed down because of a mistake or made a mistake because you sped up.

The last, partial second

A timed test splits evenly into whole seconds. A word or quote test rarely does. If the leftover time after the last whole second is at least half a second, it becomes its own, shorter slice, and its speed is calculated over its real length. If it is shorter, it is left out of the per-second data.

test ends at 12.62 s → 12 slices + a 0.62 s slice
5 characters in the last slice: (5 / 5) / (0.62 / 60) ≈ 97

test ends at 12.38 s → 12 slices only
the last 0.38 s is not in the chart or in consistency

This only affects the per-second data. WPM, raw and accuracy always use everything you typed and the full duration.

AFK seconds

A slice in which you pressed no key at all counts as an AFK (away from keyboard) second. Hover over the test time on the result screen to see the total, for example "30s (3s afk 10%)" for three idle seconds in a 30-second test.

Consistency, more closely

Consistency is calculated from the burst values above. PuggieType takes the per-second burst speeds, works out their mean and standard deviation, and divides one by the other to get the coefficient of variation, c. The standard deviation is the population version: the squared differences from the mean are divided by the number of slices, not by one less. Then c goes through this curve:

consistency = 100 × (1 - tanh(c + c³/3 + c⁵/5))

Why the curve is nearly a straight line

The expression inside the brackets looks arbitrary, but it is the start of a well-known series: c + c³/3 + c⁵/5 + … is the inverse hyperbolic tangent of c. Applying tanh to it almost undoes it, so for small and moderate spreads the formula comes out very close to:

consistency ≈ 100 × (1 - c)

In plain terms: if your per-second speed typically strays about 10% from your average, your consistency is about 90%. The approximation holds well for small values of c and drifts as c grows:

c (spread ÷ mean)Consistency
0.0595.0%
0.1090.0%
0.2080.0%
0.3070.0%
0.5050.1%
0.7526.6%
1.008.9%

Past about c = 0.5 the score falls faster than the straight line, and it never goes below zero. Very bursty typing, with seconds of nothing between flurries, lands in that steep part.

Worked example

Five slices with burst values of 84, 72, 84, 96 and 72:

mean = 408 / 5 = 81.6
differences from mean: 2.4, -9.6, 2.4, 14.4, -9.6
population variance = (5.76 + 92.16 + 5.76 + 207.36 + 92.16) / 5 = 80.64
standard deviation = √80.64 ≈ 8.98
c = 8.98 / 81.6 ≈ 0.110
consistency ≈ 89.00%     (shortcut: 100 × (1 - 0.110) = 89.0)

Had the sample version been used (dividing by 4 instead of 5), the standard deviation would be about 10.04 and the score about 87.7%. The difference shrinks as tests get longer, but it matters if you check a short test by hand.

Note that because consistency is relative to your own average, it does not reward speed or punish slowness. A steady 40 wpm and a steady 120 wpm can earn the same score.

Key consistency

Hover over consistency on the result screen and you will see a second figure marked "key". It uses the same curve, but on a different input: the time between one key going down and the next, in milliseconds. The gap before the final keypress is dropped. Where the main score looks at output per second, key consistency looks at the rhythm of individual keystrokes.

gaps between keypresses: 180, 200, 160, 220, 190, 240 ms
drop the last gap: 180, 200, 160, 220, 190
mean = 190 ms, standard deviation = 20 ms
c = 20 / 190 ≈ 0.105
key consistency ≈ 89.47%

Key consistency is often lower than the main score. Even smooth typists are quick on familiar letter pairs and slower across awkward reaches, and that unevenness averages out within a second but not between single keys.

Using the numbers well

The arithmetic points to a few practical habits. Compare results from tests of the same length, since short tests magnify both luck and mistakes. Read accuracy alongside the raw counts in its tooltip rather than the rounded figure. Use the chart's error series to see where your mistakes cluster, and treat consistency as a measure of rhythm, not of skill.

Related guides