{
  "schemaVersion": 1,
  "slug": "typing-speed-calculator",
  "category": "everyday",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "c6d14ea749908e2040feac16ec8f5c317b0ff800e1fe231bebd297cea77808d7",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/typing-speed-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "gross = chars ÷ 5 ÷ minutes; net = max(0, gross − errors ÷ minutes)",
    "vars": [
      [
        "C",
        "Characters typed"
      ],
      [
        "e",
        "Errors"
      ],
      [
        "T",
        "Time typing (min)"
      ],
      [
        "G",
        "Gross speed (wpm)"
      ],
      [
        "N",
        "Net speed (wpm)"
      ],
      [
        "A",
        "Accuracy (%)"
      ]
    ],
    "note": "Five characters per word and an uncorrected-character-error penalty per minute are this simplified practice model. Accuracy = (C − e) / C × 100; characters per second = C / (60T). Errors must not exceed characters. No skill grade is produced; hourly/1,000-word outputs extrapolate the same net rate."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "if(![charactersTyped,minutes,seconds,errors,targetWpm].every(Number.isFinite)||![charactersTyped,minutes,seconds,errors,targetWpm].every(Number.isInteger)||charactersTyped<1||charactersTyped>50000||minutes<0||minutes>240||seconds<0||seconds>59||errors<0||errors>5000||errors>charactersTyped||targetWpm<5||targetWpm>200)return {netWpm:null,grossWpm:null,cpm:null,accuracy:null,wordsPerHour:null,keystrokesPerSecond:null,timeFor1000Words:null,paceVsTarget:null,__error:'inputError'}; const totalMinutes=minutes+seconds/60;if(totalMinutes<=0)return{netWpm:null,grossWpm:null,cpm:null,accuracy:null,wordsPerHour:null,keystrokesPerSecond:null,timeFor1000Words:null,paceVsTarget:null,__error:'inputError'};const gross=charactersTyped/5/totalMinutes,cpm=charactersTyped/totalMinutes,accuracy=charactersTyped>0?Math.max(0,(charactersTyped-errors)/charactersTyped*100):0,net=Math.max(0,gross-errors/totalMinutes),kps=charactersTyped/(totalMinutes*60);return{netWpm:net,grossWpm:gross,cpm,accuracy,wordsPerHour:net*60,keystrokesPerSecond:kps,timeFor1000Words:net>0?1000/net:null,paceVsTarget:targetWpm>0?net/targetWpm*100:0};",
    "inputs": [
      {
        "name": "charactersTyped",
        "type": "number",
        "default": 750,
        "min": 1,
        "max": 50000,
        "step": 1,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "minutes",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 240,
        "step": 1,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "seconds",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 59,
        "step": 1,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "errors",
        "type": "number",
        "default": 6,
        "min": 0,
        "max": 5000,
        "step": 1,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "targetWpm",
        "type": "number",
        "default": 60,
        "min": 5,
        "max": 200,
        "step": 1,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      }
    ],
    "outputs": [
      {
        "name": "netWpm",
        "precision": 1,
        "unit": "wpm",
        "notation": "auto"
      },
      {
        "name": "grossWpm",
        "precision": 1,
        "unit": "wpm",
        "notation": "auto"
      },
      {
        "name": "cpm",
        "precision": 0,
        "unit": "cpm",
        "notation": "auto"
      },
      {
        "name": "accuracy",
        "precision": 1,
        "unit": "%",
        "notation": "auto"
      },
      {
        "name": "wordsPerHour",
        "precision": 0,
        "unit": "words",
        "notation": "auto"
      },
      {
        "name": "keystrokesPerSecond",
        "precision": 1,
        "unit": "",
        "notation": "auto"
      },
      {
        "name": "timeFor1000Words",
        "precision": 1,
        "unit": "min",
        "optional": true,
        "notation": "auto"
      },
      {
        "name": "paceVsTarget",
        "precision": 0,
        "unit": "%",
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
