This calculator helps you determine your heart rate directly from an electrocardiogram (ECG) reading. The heart rate is calculated based on the time between successive R-waves (the tall peak in the QRS complex) on the ECG strip.
Alternatively, if you know the paper speed and the number of small boxes between R-waves:
function calculateHeartRate() {
var rrIntervalInput = document.getElementById("rrInterval");
var paperSpeedInput = document.getElementById("paperSpeed");
var smallBoxesInput = document.getElementById("smallBoxes");
var resultDiv = document.getElementById("result");
var rrInterval = parseFloat(rrIntervalInput.value);
var paperSpeed = parseFloat(paperSpeedInput.value);
var smallBoxes = parseFloat(smallBoxesInput.value);
var heartRate = NaN; // Initialize as Not a Number
if (!isNaN(rrInterval) && rrInterval > 0) {
// Method 1: Using R-R interval in seconds
// Heart Rate (bpm) = 60 / R-R interval (seconds)
heartRate = 60 / rrInterval;
} else if (!isNaN(paperSpeed) && paperSpeed > 0 && !isNaN(smallBoxes) && smallBoxes > 0) {
// Method 2: Using paper speed and number of small boxes
// Time for one small box = 1 second / paper speed (mm/sec) / (mm per small box, typically 1mm)
// R-R interval (seconds) = Number of small boxes * (1 / paper speed)
// Heart Rate (bpm) = 60 / R-R interval (seconds)
// Simplified: Heart Rate (bpm) = 60 * paper speed / Number of small boxes
heartRate = (60 * paperSpeed) / smallBoxes;
}
if (!isNaN(heartRate)) {
resultDiv.innerHTML = "