Changes in heart rate are a useful physiological measure in infant studies. We present an algorithm for calculating the heart rate (HR) from oxyhemoglobin pulsation in functional near-infrared spectroscopy (fNIRS) signals. The algorithm is applied to data collected from 10 infants, and the HR derived from the fNIRS signals is compared against the HR as calculated by electrocardiography. We show high agreement between the two HR signals for all infants (), and also compare stimulus-related HR responses as measured by the two methods and find good agreement despite high levels of movement in the infants. This algorithm can be used to measure changes in HR in infants participating in fNIRS studies without the need for additional HR sensors.