In clinical electrocardiography (ECG), calculating the heart rate is a fundamental skill. The QRS complex represents ventricular depolarization, and the distance between consecutive QRS complexes (specifically the R-R interval) allows us to determine the beats per minute (BPM).
The Mathematical Principles
Standard ECG paper moves at a speed of 25 mm/sec. This means:
1 Small Box = 1 mm = 0.04 seconds.
1 Large Box = 5 mm = 0.20 seconds.
1500 Small Boxes = 1 minute.
300 Large Boxes = 1 minute.
The 1500 Method (Most Accurate)
For regular rhythms, count the number of small boxes between two consecutive R waves and divide 1500 by that number.
Formula: 1500 / (number of small boxes) = Heart Rate.
The 300 Method (The Sequence Method)
Count the number of large boxes between R waves.
Formula: 300 / (number of large boxes) = Heart Rate.
Common sequence: 300 – 150 – 100 – 75 – 60 – 50.
Example Calculation
If you identify 20 small boxes between two QRS complexes on an ECG strip:
Use the 1500 rule: 1500 divided by 20.
Result: 75 BPM.
Important Note on Irregular Rhythms
If the rhythm is irregular (like Atrial Fibrillation), the methods above are inaccurate. Instead, use the 6-second method: Count the number of QRS complexes in a 6-second strip (usually 30 large boxes) and multiply by 10.
function calculateQRSHeartRate() {
var smallBoxes = parseFloat(document.getElementById('smallBoxes').value);
var largeBoxes = parseFloat(document.getElementById('largeBoxes').value);
var resultDiv = document.getElementById('heartRateResult');
var bpmOutput = document.getElementById('bpmOutput');
var rhythmCategory = document.getElementById('rhythmCategory');
var finalBpm = 0;
// Reset styles
resultDiv.style.display = 'block';
resultDiv.style.backgroundColor = '#f1f1f1';
if (smallBoxes > 0) {
finalBpm = 1500 / smallBoxes;
// Also update large boxes for consistency
document.getElementById('largeBoxes').value = (smallBoxes / 5).toFixed(1);
} else if (largeBoxes > 0) {
finalBpm = 300 / largeBoxes;
// Also update small boxes for consistency
document.getElementById('smallBoxes').value = (largeBoxes * 5).toFixed(0);
} else {
bpmOutput.innerHTML = "Error";
rhythmCategory.innerHTML = "Please enter the number of boxes between R waves.";
return;
}
var roundedBpm = Math.round(finalBpm);
bpmOutput.innerHTML = roundedBpm + " BPM";
// Category Logic
if (roundedBpm 100) {
rhythmCategory.innerHTML = "Category: Tachycardia (Fast Heart Rate)";
rhythmCategory.style.color = "#d32f2f";
} else {
rhythmCategory.innerHTML = "Category: Normal Sinus Range";
rhythmCategory.style.color = "#388e3c";
}
}