A heartbeat detection device includes a difference value calculation unit (3) for calculating, from a sampling data sequence of an electrocardiographic waveform of a living body, one of an amount of change and a degree of change of sampling data for each sampling time, a multiplication unit (4) for calculating, for each sampling time, a product by multiplying one of an amount of change and a degree of change of the sampling data at a time K by one of the sampling data at the time K and sampling data at a time before the time K by a predetermined time t, a peak detection unit (5) for detecting a peak of the product, and a heartbeat time determination unit (6) for setting time of the peak of the product as a heartbeat time.