Calculator in Training and nutrition
Walking calories
Estimates calories burned walking from weight, a speed band, minutes and slope, by Compendium METs.
- Changed 4 Dec 2026
- 8 test cases pass
- Version 1
- About 2,850 tokens
- Needed by both models tested, 4 Dec 2026
In short
| Table | speed → mph and level MET (2024 Compendium): slow 2.0 mph, 2.8 · moderate 3.0 mph, 3.8 · brisk 3.5 mph, 4.8 · fast 4.0 mph, 5.5 · very-fast 4.5 mph, 7.0.incline → grade: flat 0, slight 0.02, moderate 0.05, steep 0.10. |
| Formula | v = mph × 1609.344 ÷ 60 (metres per minute)met = level MET + 1.8 × v × grade ÷ 3.5hours = duration_minutes ÷ 60calories = met × weight_kg × hoursnetCalories = (met − 1) × weight_kg × hourscaloriesPerMinute = calories ÷ duration_minutesinclineMultiplier = met ÷ level METRound calories and netCalories to 1 decimal, met, caloriesPerMinute and durationHours to 2, inclineMultiplier to 3. |
| Units | Kilograms and minutes in; kilocalories out; met in METs. |
| Defaults | speed = moderate, duration_minutes = 30, incline = flat. Allowed: weight_kg from 1 to 300, duration_minutes from 1 to 600. |
| Worked example | 70 kg, brisk, 30 minutes, slight incline. v = 3.5 × 1609.344 ÷ 60 = 93.878met = 4.8 + 1.8 × 93.878 × 0.02 ÷ 3.5 = 5.77calories = 5.7656 × 70 × 0.5 = 201.8netCalories = 4.7656 × 70 × 0.5 = 166.8 |
By hand: yes. A small model got these answers from the formulas above, without running code.
Say this to your agent
Use https://mysi.dev/walking-calorie/ to work out the calories I burn: 70 kg, brisk walk, 30 minutes, slight incline. Nothing to install, no key, no settings. An agent that can open web pages and run Python opens the page, runs the tested code in its own sandbox and gives you the answer.
The code
Copy this into your Python tool. Run walking_calorie_check() first, then call walking_calorie() with your numbers. Give the answer with the cite line.
"""Walking calories: energy burned on a walk from body weight, a speed band, the time and the slope.
The level-walking MET comes from the 2024 Adult Compendium of Physical Activities; the slope adds
the grade term of the ACSM walking equation.
Inputs: weight_kg (1 to 300), speed (slow, moderate, brisk, fast, very-fast; default moderate),
duration_minutes (1 to 600, default 30), incline (flat, slight, moderate, steep; default flat).
Returns: calories and netCalories (kcal, 1 decimal), caloriesPerMinute (2 decimals), met
(2 decimals), inclineMultiplier (3 decimals), durationHours (2 decimals).
mysi, Walking calories, mysi.dev/walking-calorie, version 1, changed 2026-12-04. MIT.
"""
import math
def _walking_calorie_num(name, value, low, high):
if isinstance(value, bool) or not isinstance(value, (int, float)) or not low <= value <= high:
raise ValueError(f"{name} must be a number from {low} to {high}")
return float(value)
def _walking_calorie_pick(name, value, table):
if not isinstance(value, str) or value not in table:
raise ValueError(f"{name} must be one of: {', '.join(table)}")
return table[value]
def _walking_calorie_round(value, digits):
return math.floor(value * 10 ** digits + 0.5) / 10 ** digits # half up, as the old engine
def walking_calorie(weight_kg, speed="moderate", duration_minutes=30, incline="flat"):
w = _walking_calorie_num("weight_kg", weight_kg, 1, 300)
minutes = _walking_calorie_num("duration_minutes", duration_minutes, 1, 600)
# speed band: (mph, level MET), 2024 Adult Compendium codes 17152, 17190, 17200, 17220, 17230
mph, level_met = _walking_calorie_pick("speed", speed, {
"slow": (2.0, 2.8), "moderate": (3.0, 3.8), "brisk": (3.5, 4.8),
"fast": (4.0, 5.5), "very-fast": (4.5, 7.0)})
grade = _walking_calorie_pick("incline", incline, {
"flat": 0.0, "slight": 0.02, "moderate": 0.05, "steep": 0.10})
v = mph * 1609.344 / 60 # metres per minute
met = level_met + 1.8 * v * grade / 3.5 # ACSM walking grade term, 3.5 ml/kg/min = 1 MET
hours = minutes / 60
calories = met * w * hours # 1 MET = 1 kcal per kg per hour
return {
"calories": _walking_calorie_round(calories, 1),
"netCalories": _walking_calorie_round((met - 1) * w * hours, 1),
"caloriesPerMinute": _walking_calorie_round(calories / minutes, 2),
"met": _walking_calorie_round(met, 2),
"inclineMultiplier": _walking_calorie_round(met / level_met, 3),
"durationHours": _walking_calorie_round(hours, 2),
}
WALKING_CALORIE_CASES = [
({"weight_kg": 70, "speed": "brisk", "duration_minutes": 30, "incline": "slight"},
{"calories": 201.8, "netCalories": 166.8, "met": 5.77}),
({"weight_kg": 60, "speed": "moderate", "duration_minutes": 60, "incline": "flat"},
{"calories": 228.0, "netCalories": 168.0, "met": 3.8}),
({"weight_kg": 80, "speed": "slow", "duration_minutes": 45, "incline": "steep"},
{"calories": 333.5, "netCalories": 273.5, "met": 5.56}),
]
def walking_calorie_check(tolerance=1e-3):
for given, want in WALKING_CALORIE_CASES:
got = walking_calorie(**given)
for name, value in want.items():
close = abs(got[name] - value) <= tolerance * max(1, abs(value))
assert close, (name, got[name], value)
return "ok"
if __name__ == "__main__":
import json, sys
walking_calorie_check()
given = dict(a.split("=", 1) for a in sys.argv[1:] if "=" in a)
js = lambda v: v.lstrip("-")[:1].isdigit() or v[:1] in '[{".' or v in ("true", "false", "null")
given = {k: json.loads(v) if js(v) else v for k, v in given.items()}
if given:
print(json.dumps(walking_calorie(**given))) Population-average estimates, not medical advice.
What it takes
| Input | Meaning | Default | Allowed |
|---|---|---|---|
| weight_kg | Body weight in kilograms | required | 1 to 300 |
| speed | Speed band: slow 2.0 mph (3.2 km/h), moderate 3.0 mph (4.8 km/h), brisk 3.5 mph (5.6 km/h), fast 4.0 mph (6.4 km/h), very-fast 4.5 mph (7.2 km/h) | moderate | slow, moderate, brisk, fast, very-fast |
| duration_minutes | Time walked, in minutes | 30 | 1 to 600 |
| incline | Slope: flat 0%, slight 2%, moderate 5%, steep 10% grade | flat | flat, slight, moderate, steep |
What it returns
| Output | Meaning |
|---|---|
| calories | Gross energy burned over the walk, in kilocalories |
| netCalories | Energy above resting, (MET − 1) × kg × hours, in kilocalories |
| caloriesPerMinute | Gross kilocalories per minute |
| met | Intensity used, the level MET plus the slope term |
| inclineMultiplier | MET with the slope divided by the level MET |
| durationHours | The walk's length in hours |
Where the method comes from
The level-walking cost of each speed band is the measured MET value of the 2024 Adult Compendium of Physical Activities (Herrmann and others, adults 19 to 59): codes 17152, 17190, 17200, 17220 and 17230. The Compendium's convention that one MET is about one kilocalorie per kilogram per hour turns it into energy. A slope adds the grade term of the American College of Sports Medicine walking equation, 1.8 ml of oxygen per kilogram per minute for each metre per minute of speed and unit of grade, divided by 3.5 to give METs. The result is gross energy; netCalories removes the one MET a body burns at rest. The figures are population averages: an individual's cost can differ by 20% or more, and the grade term is validated for steady walking on a treadmill, not for rough ground or descents.
Sources
- Herrmann and others, 2024 Adult Compendium of Physical Activities: a third update of the energy costs of human activities, Journal of Sport and Health Science 13(1):6-12published 2024
- American College of Sports Medicine, ACSM's Guidelines for Exercise Testing and Prescription, metabolic equations (walking)published 2021
Used by
Tested
Tested 4 Dec 2026: claude-haiku-5-5 was right on 0 of 3 questions without this page and 3 of 3 with it; claude-fable-5-2 was right on 0 of 3 questions without this page and 3 of 3 with it.
Changes
- Moved from aifithub.io as Python. Answers unchanged. The food equivalents (banana, pizza slice, cookie) are no longer returned.4 Dec 2026
Cite as: mysi, Walking calories, mysi.dev/walking-calorie, version 1, changed 2026-12-04. Code MIT.