{
  "id": "pace",
  "version": "6598d768ffab",
  "status": "published",
  "name": "Pace Calculator",
  "question": "What is my running pace?",
  "summary": "Computes running pace per mile or per kilometer from distance and time, or the finish time or distance from a pace, with the average speed.",
  "category": "sports",
  "subcategory": "running",
  "url": "https://www.acalculator.org/sports/pace-calculator",
  "markdown": "https://www.acalculator.org/sports/pace-calculator.md",
  "kind": "formulas",
  "method": "pace = time ÷ distance, with the distance in miles (1 mi = 1,609.344 m) or kilometers; speed = distance ÷ time.",
  "assumptions": [
    "The pace is the average over the whole distance, as if every mile or kilometer took the same time.",
    "Finish time and paces are rounded to the nearest second for display.",
    "The distance is at least 1 meter, and the time and the pace are at least 1 second."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "d": {
        "title": "Distance",
        "description": "The distance of the run or race. A marathon is 42.195 km (26.2188 mi).",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 1
      },
      "t": {
        "title": "Time",
        "description": "The time taken for the whole distance.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "time",
        "minimum": 1
      },
      "p": {
        "title": "Pace",
        "description": "The time taken for each mile or each kilometer.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "time",
        "minimum": 1
      },
      "per": {
        "title": "Pace per",
        "description": "Whether the pace is the time per mile or the time per kilometer.",
        "type": "string",
        "enum": [
          "mi",
          "km"
        ]
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "d",
      "t",
      "p"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "distance": {
      "label": "Distance",
      "description": "The distance of the run or race. A marathon is 42.195 km (26.2188 mi).",
      "format": "quantity"
    },
    "time": {
      "label": "Time",
      "description": "The time taken for the whole distance.",
      "format": "quantity"
    },
    "pace": {
      "label": "Pace",
      "description": "The time taken for each mile or each kilometer.",
      "format": "quantity"
    },
    "paceClock": {
      "label": "Pace",
      "description": "The pace per mile or per kilometer (as chosen), as m:ss.",
      "format": "text"
    },
    "finish": {
      "label": "Finish time",
      "description": "The time for the whole distance, as h:mm:ss.",
      "format": "text"
    },
    "perMile": {
      "label": "Pace per mile",
      "description": "The time for each mile, as m:ss.",
      "format": "text"
    },
    "perKm": {
      "label": "Pace per kilometer",
      "description": "The time for each kilometer, as m:ss.",
      "format": "text"
    },
    "speed": {
      "label": "Average speed",
      "description": "The average speed: distance ÷ time.",
      "format": "quantity",
      "unit": "mph"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "per": "mi",
      "d": 42195,
      "t": 12600
    },
    "outputs": {
      "pace": 480.5719729825809,
      "paceClock": "8:01",
      "finish": "3:30:00",
      "perMile": "8:01",
      "perKm": "4:59",
      "speed": 3.348809523809524
    },
    "text": "Covering 26.22 mi in 210 min is a pace of 8.01 min."
  },
  "examples": [
    {
      "given": {
        "per": "mi",
        "d": 42195,
        "t": 12600
      },
      "expect": {
        "p": 480.5719729825809,
        "perMile": "8:01",
        "perKm": "4:59",
        "finish": "3:30:00",
        "speed": 3.348809523809524
      },
      "source": "hand calculation in content.mdx: 12,600 s ÷ (42,195 ÷ 1,609.344) mi = 480.57 s = 8:01 per mile; 12,600 ÷ 42.195 = 298.61 s = 4:59 per km (World Athletics: marathon 42.195 km; NIST SP 811: 1 mi = 1,609.344 m)"
    },
    {
      "given": {
        "per": "km",
        "d": 5000,
        "t": 1500
      },
      "expect": {
        "p": 300,
        "paceClock": "5:00",
        "perKm": "5:00",
        "perMile": "8:03"
      },
      "source": "hand calculation in content.mdx: 1,500 s ÷ 5 km = 300 s = 5:00 per km; 300 × 1.609344 = 482.8 s = 8:03 per mile",
      "tolerance": 1e-12
    },
    {
      "given": {
        "per": "mi",
        "d": 16093.44,
        "p": 480
      },
      "expect": {
        "t": 4800,
        "finish": "1:20:00"
      },
      "source": "hand calculation in content.mdx: 10 × 480 s = 4,800 s = 1:20:00",
      "tolerance": 1e-12
    },
    {
      "given": {
        "per": "km",
        "t": 3600,
        "p": 240
      },
      "expect": {
        "d": 15000
      },
      "source": "hand calculation in content.mdx: 3,600 s ÷ 240 s per km = 15 km",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "World Athletics, Competition Rules (road races): the marathon is 42.195 km. https://worldathletics.org/about-iaaf/documents/book-of-rules",
    "NIST Special Publication 811 (2008), Appendix B.8: 1 mi = 1,609.344 m exactly. https://www.nist.gov/pml/special-publication-811"
  ],
  "related": [
    "speed",
    "vo2-max"
  ],
  "changelog": []
}
