How to Calculate Heart Rate Variability: RMSSD & SDNN

Heart rate variability (HRV) is calculated by measuring the time gaps between consecutive heartbeats and then running statistical formulas on those gaps. The most common calculation, called RMSSD, captures beat-to-beat variation in milliseconds and is the same metric used by Apple Watch, Oura Ring, and WHOOP. Whether you’re trying to understand what your wearable is doing behind the scenes or computing HRV from raw data, the process starts with the same raw ingredient: a precise series of inter-beat intervals.

Step 1: Capture the Beat-to-Beat Intervals

Every HRV calculation begins with a list of the time gaps between successive heartbeats, measured in milliseconds. These are called RR intervals (or NN intervals, where “NN” means only normal, healthy beats are included). If your heart beats at times 0 ms, 832 ms, 1,750 ms, and 2,540 ms, your RR intervals are 832 ms, 918 ms, and 790 ms.

Medical-grade electrocardiograms (ECGs) detect the sharp electrical spike of each heartbeat, making it straightforward to pinpoint the exact moment of each beat. Wearable devices like smartwatches and fitness rings use optical sensors instead, shining light into your skin and tracking changes in blood volume. This produces a smoother, rounder wave, which makes it harder to identify the precise peak of each beat. A 2025 study in Frontiers in Physiology found that optical sensors systematically underestimated RMSSD by about 5.6 ms and SDNN by about 13 ms compared to ECG readings taken at the same time. For tracking personal trends day to day, optical sensors still work. But the absolute numbers from a wrist sensor and a chest-strap ECG won’t match perfectly.

Step 2: Clean the Data

Before you calculate anything, the raw intervals need to be cleaned. A skipped beat, a motion artifact, or a premature heartbeat can dramatically skew results because HRV metrics are sensitive to outliers. Cleaning typically means identifying intervals that are abnormally short or long compared to their neighbors, then either removing or correcting them. Software tools handle this automatically, but if you’re working manually, a common approach is to flag any interval that deviates more than 20 to 25 percent from the surrounding average and exclude it. Only “normal-to-normal” intervals survive this step, which is why the cleaned series is called the NN interval series.

The Two Core Time-Domain Calculations

Time-domain metrics are the simplest HRV calculations, and two dominate the field: RMSSD and SDNN. They answer slightly different questions about your heart’s variability.

RMSSD

RMSSD stands for the root mean square of successive differences. It focuses on how much each beat-to-beat interval changes from the one right before it. Here’s the step-by-step math:

  • Subtract each interval from the next. If your NN intervals are 832, 918, and 790 ms, the successive differences are +86 and −128.
  • Square each difference. That gives you 7,396 and 16,384.
  • Take the mean of those squared values. (7,396 + 16,384) / 2 = 11,890.
  • Take the square root. √11,890 ≈ 109 ms.

RMSSD reflects short-term variability and is driven primarily by your parasympathetic nervous system, the “rest and digest” branch. It’s the metric that virtually all consumer wearables report as your HRV score.

SDNN

SDNN is simply the standard deviation of all NN intervals in your recording. Rather than looking at beat-to-beat changes, it captures the overall spread of intervals across the entire measurement window. If you recorded 300 intervals and their standard deviation is 54 ms, your SDNN is 54 ms.

Because SDNN reflects total variability over time, it’s influenced by both the parasympathetic and sympathetic branches of the nervous system. It’s also highly dependent on recording length. A 5-minute SDNN and a 24-hour SDNN are not comparable, so you should never mix measurement durations when tracking trends.

Frequency-Domain Analysis

Instead of summarizing intervals with a single number, frequency-domain analysis breaks the pattern of heartbeat fluctuations into different speed components, much like separating a sound recording into bass, midrange, and treble. The NN interval series is transformed using a mathematical technique (typically a Fourier transform) that reveals how much of the total variability occurs at each frequency.

Three main frequency bands emerge:

  • Very Low Frequency (VLF): below 0.04 Hz, linked to slow regulatory processes like temperature regulation and hormonal rhythms.
  • Low Frequency (LF): 0.04 to 0.15 Hz, a mixed signal reflecting both parasympathetic and sympathetic input. Roughly half its power comes from parasympathetic activity and about a quarter from sympathetic activity.
  • High Frequency (HF): 0.15 to 0.4 Hz, closely tied to breathing and primarily reflects parasympathetic activity (about 90 percent parasympathetic, 10 percent sympathetic).

You’ll sometimes see results expressed in absolute power (measured in ms²) or in normalized units, which show LF and HF as percentages of their combined total. Absolute values are generally more informative because they reveal the actual magnitude of autonomic activity. Normalized LF and HF are mathematically dependent on each other (if one goes up, the other must go down), which limits their usefulness and makes reporting both redundant.

The LF/HF ratio was once widely promoted as a measure of sympathetic-to-parasympathetic balance, but this interpretation has been challenged. Because LF contains substantial parasympathetic input, the ratio doesn’t cleanly separate the two branches of the nervous system.

How Wearables Calculate Your Score

Consumer devices simplify all of this into a single number. Oura Ring, WHOOP, and Eight Sleep all use RMSSD as their core HRV metric, measured through optical sensors on your finger, wrist, or body. Most take their readings overnight or in the early morning hours when your body is at rest, which minimizes noise from movement and daily stressors.

The number your device shows may not be raw RMSSD. Some apps apply a natural logarithm to the value (called lnRMSSD), which compresses the scale and makes day-to-day changes easier to interpret. Others average multiple short readings taken throughout the night. The important thing is that your device uses the same method every time, so your trend line is internally consistent even if the absolute number doesn’t match a clinical ECG reading.

Getting Reliable Measurements

HRV is sensitive to almost everything: sleep, stress, alcohol, exercise, caffeine, body position, and time of day. That sensitivity is what makes it useful, but it also means sloppy measurement habits will produce meaningless data.

The most reliable approach for daily tracking is to measure first thing in the morning, before eating, drinking coffee, or exercising. Consistency in timing and body position matters more than the specific time you choose. If you measure seated one day and lying down the next, the positional difference alone can shift your reading. Pick one position and stick with it.

For recording length, a minimum of five minutes gives a reliable snapshot for time-domain metrics like RMSSD. Frequency-domain analysis, particularly VLF, requires longer recordings. A 24-hour recording captures the full range of autonomic activity across sleep, waking, and all the stressors in between, but it requires a continuously worn monitor. If you’re using a wearable that records overnight, you’re getting several hours of data, which is a solid middle ground.

Aim to record every day. If that’s not realistic, at least three measurements per week gives you enough data points to spot meaningful trends rather than reacting to random day-to-day swings. HRV is most useful as a trend over weeks and months, not as a single snapshot.

What the Numbers Actually Mean

There’s no universal “good” HRV number. Values vary dramatically by age, fitness level, and genetics. A healthy 25-year-old might have an RMSSD above 60 ms, while a healthy 60-year-old might sit around 20 to 30 ms. Comparing your number to someone else’s is largely pointless.

What matters is your personal baseline and how your numbers move relative to it. A sustained drop in your HRV trend can signal accumulated stress, inadequate recovery, illness onset, or overtraining. A rising trend generally reflects improving fitness, better sleep quality, or reduced stress load. Single-day dips after a hard workout or a poor night of sleep are normal and expected. The pattern over one to two weeks tells the real story.