An electronic device (1a) includes an acceleration sensor (16) configured to detect an acceleration value, an atmospheric pressure sensor (17) configured to detect an atmospheric pressure value, and a controller (19). The controller (19) is configured to calculate the amount of activity or the number of steps based on the acceleration value detected by the acceleration sensor (16) and the atmospheric pressure value detected by the atmospheric pressure sensor (17).