Docs / Testing Guide / How We Calculate

How We Calculate

4 min read

This article lists every formula this app uses to calculate your glucose metrics. All calculations are based on published research and standard clinical methods. If you have ever wondered exactly how a number is computed, this is the reference.

How It Works

Mean (Average Glucose)

Mean = Sum of all readings ÷ Number of readings

Example: (95 + 142 + 108) ÷ 3 = 115 mg/dL


Standard Deviation (SD)

SD measures how spread out your readings are from the mean.

  1. Calculate the mean.
  2. Find the difference between each reading and the mean, and square it.
  3. Average all those squared differences.
  4. Take the square root of that average.

A lower SD means more consistent glucose. A higher SD means wider swings.


Coefficient of Variation (CV)

CV = (SD ÷ Mean) × 100%

Example: SD of 20, mean of 110 → CV = (20 ÷ 110) × 100 = 18.2%

CV below 25% is the goal for stability.


Glucose Management Indicator (GMI)

GMI = 3.31 + (0.02392 × mean glucose in mg/dL)

Example: mean glucose 115 mg/dL → GMI = 3.31 + (0.02392 × 115) = 3.31 + 2.75 = 6.06%

Requires at least 14 days of data for a meaningful result.


Time in Range (TIR)

TIR = (Number of readings between 70 and 140 mg/dL ÷ Total readings) × 100%

Similar calculations produce Time Below Range (TBR) and Time Above Range (TAR) for the other glucose zones.


Post-Meal Spike

Spike = Post-meal reading − Pre-meal reading

The post-meal reading is the one taken closest to 1–2 hours after the meal.


LBGI (Low Blood Glucose Index) and HBGI (High Blood Glucose Index)

These use the Kovatchev transformation, which maps glucose values onto a symmetric risk scale using natural logarithms. The transformation makes both low and high values contribute proportionally to risk, with extreme values weighted more heavily.

The transformation: f(g) = 1.794 × ((ln(g))^1.026 − 1.861)

LBGI sums the risk contributions from all readings below 112.5 mg/dL. HBGI sums the risk contributions from all readings above 112.5 mg/dL. Both are expressed as averages across your readings.


Trend Direction

Trend = 3-day average fasting glucose − 7-day average fasting glucose

If this value is less than −5: improving (downward arrow) If this value is between −5 and +5: stable (right arrow) If this value is greater than +5: worsening (upward arrow)


MAGE (Mean Amplitude of Glycemic Excursions)

MAGE identifies all peaks and troughs in your readings that exceed one standard deviation from your mean. It then averages the amplitude (size) of those qualifying excursions.


MODD (Mean of Daily Differences)

MODD compares readings taken at the same time on consecutive days and averages the absolute differences across all such pairs.

Why This Matters

Transparency builds trust. When you see a number in this app, you can verify exactly how it was calculated. No proprietary black boxes — just published, peer-reviewed formulas applied to your readings.


Based on: Bergenstal et al., Diabetes Care 2018; Kovatchev et al., Diabetes Care 1997; Service et al., Diabetes 1970; Danne et al., Diabetes Care 2017

View full citations