Methods · My glucose
How the glucose charts are calculated
A guide to the calculations currently used by My glucose, including what happens when readings are missing.
Implementation reviewed October 14, 2026. Experimental, descriptive software; not clinically validated and not a dosing tool.
1. Which readings are included?
The import expects a timestamp column and a glucose column. Timestamps must begin with a year-first date and time, such as 2026-09-01 08:30 or an ISO timestamp with a time-zone offset. Ambiguous month/day formats are rejected. Use the file-units selector: mmol/L values are multiplied by 18; charts and calculations then use mg/dL.
The parser skips unreadable timestamps, empty or nonnumeric glucose values, and values outside 20–600 mg/dL. These are software input limits, not a statement about which readings are medically possible. If an Event Type column is present, only rows labeled EGV are kept. A glucose heading that specifies units must agree with the selector.
Readings are sorted by timestamp. Identical duplicate readings count once. If the same timestamp has different valid glucose values, all readings at that timestamp are excluded rather than choosing one. At least three valid readings must remain, and the file must be no larger than 10 MB.
Days and hours use your browser’s local time zone. An explicit timestamp offset is converted to that zone; a date-time without an offset is interpreted locally. The same file can therefore have different day boundaries in different browser time zones. The file is processed in this tab, without uploading or permanently saving the readings. See privacy details.
2. Recorded coverage and time in range
The gap limit adapts to the imported cadence. The code sorts positive intervals of at most 30 minutes and selects the middle interval (the upper middle for an even count). With no qualifying intervals, it uses five minutes. The allowed gap is twice that interval, with a minimum of 7.5 and a maximum of 15 minutes.
Each reading contributes time until the next reading only if the interval is within that gap limit and both readings fall on the same local calendar day. Longer gaps and intervals crossing midnight are excluded in full. The final reading contributes no interval. There is no filling of missing readings or extension to the end of the day.
Each included interval is assigned the glucose value at its start: below 70, 70 through 180 inclusive, or above 180 mg/dL. The calculation does not interpolate a crossing between two readings. Each daily percentage is the minutes in that band divided by covered minutes, multiplied by 100. The top-level time-in-range figure weights days by their covered minutes, rather than averaging daily percentages equally.
Worked example: readings of 60 at 08:00, 100 at 08:05, and 200 at 08:10 give ten covered minutes. Five minutes are below 70 and five are in range, so time in range is 50%. The last reading adds no time above range because there is no following reading.
A partially recorded day is not a full-day result. Missing time is excluded from the denominator, so a high percentage may describe only a small part of the day. Coverage is shown in recorded hours. The 70–180 band is the software’s fixed reference band, not an individualized treatment target.
3. Mean, variability, and hourly patterns
Mean glucose is the arithmetic mean of all retained readings, with each reading weighted equally. Variability is the population standard deviation divided by that mean, multiplied by 100: the coefficient of variation (CV). These two summaries are reading-weighted, unlike the interval-weighted range calculation. Uneven sampling can change their interpretation.
Heatmap axes can pair local hour with recorded date or weekday in either orientation. Each cell is the arithmetic mean of all available readings in that pair, with reading and distinct-day counts shown. This is reading-weighted, so densely sampled dates have more influence in weekday summaries. Empty cells stay blank; means can hide brief highs and lows. Daily overlays show the latest seven recorded days; recorded timeline curves break where a gap exceeds the allowed limit.
The timeline can add previous 7-, 14-, or 28-calendar-day averages, or the same weekday in the previous 28 days. All baselines exclude the selected day and later dates. Readings are grouped into 15-minute local-clock bins within each day; each day contributes its arithmetic bin mean. The selected across-day mean or median then gives each contributing day equal weight. At least two distinct days are required in every plotted bin; empty or insufficient bins remain blank, without interpolation. Curves are plotted at bin midpoints. Source-date counts describe days with available readings, not complete-day coverage.
Synthetic samples are deterministic illustrations: the original seven-day dataset and three 35-day patterns. Changing samples replaces the in-tab dataset across every chart. Imported CSVs continue to stay local in the browser.
Descriptive observations in the sample view
“Worth exploring” replaces the sample summary statistics with source-derived investigation prompts. Range comparisons include only dates with at least 18 recorded hours. One rule compares covered-time-weighted time above 180 in the latest seven calendar days with the preceding 28 days, requiring at least four eligible dates in each group and an increase of at least five percentage points. If that rule is not met, another looks for a difference of at least 15 percentage points between the highest and lowest daily time-in-range results across at least three eligible dates. Dates below 18 recorded hours can generate a separate coverage prompt. Actual values, dates, support, and thresholds accompany each observation.
These are descriptive screening rules, not formal statistical-significance tests, calibrated anomaly scores, causal findings, or clinical targets. Missing hours can still bias a result after the coverage screen. The action buttons carry the observation’s dates into time-in-range comparison and recorded timeline views. No observation means only that these rules did not fire, or that history was insufficient.
Day investigation: contributions and matching-clock history
Select a date or bar in Time in range to investigate that same day in the same in-tab dataset. The total above 180, four clock-block contributions, and ranked high stretches all use the covered-interval rule described above. Accepted intervals are split at clock-block boundaries; their minutes are never duplicated. The day mean here is weighted by covered duration, while minimum and maximum are observed readings. This differs from the reading-weighted summary elsewhere.
A high stretch joins consecutive covered intervals whose starting glucose is above 180. It may already be high at the start of the day. A gap ends the stretch without proving recovery, and a final high reading is not extended beyond observed coverage. Ranked stretch minutes and clock-block minutes each sum to the exact daily high total.
The default reference is the preceding 28 local calendar dates, excluding the selected day and all later dates. Historical cadence and its allowed gap are computed from these prior dates alone, so future cadence cannot affect historical eligibility. Selected-day coverage retains the whole-dataset cadence rule used by the time-in-range chart. Each historical date needs at least 18 covered hours; each usable 15-minute clock bin must be completely covered. A day contributes its duration-weighted mean for that bin once, and the historical median requires at least three eligible distinct dates. These are demo rules, not clinical sufficiency standards.
The paired comparison uses only complete clock bins in both the selected day and supported history. It averages selected-day bin mean minus historical median, weighted by the selected day’s actual covered duration. The compared minutes are its denominator; excluded covered minutes are shown separately. The median curve is not a median of whole-day averages. Partial, missing and insufficient bins are unavailable. Historical source dates, coverage, exclusions, per-bin counts and selected-day source rows can be inspected.
Daylight-saving changes retain real elapsed durations. A repeated clock bin must cover both occurrences to qualify as complete, and those occurrences contribute one duration-weighted bin value per day. Skipped bins are not filled. For a selected day with a clock change, the overlay is explicitly hidden to avoid misleading backward or skipped-clock lines; source times retain seconds, any fractional seconds and UTC offsets.
The Variable synthetic sample adds 55 mg/dL, and the Gappy sample adds 30 mg/dL, to their underlying generated curves on September 29–October 5, 2026, before rounding and value limits. These are known scenario inputs, not physiological causes discovered from glucose. The preceding-28-day reference can include other offset days. No real meal, insulin, activity, illness or device-event records are attached to these generated samples.
4. Rate of change and excursions
At each reading, the rate calculation walks backward through consecutive readings within the preceding 15 minutes, stopping before a gap above the allowed limit. With at least five minutes of history, the rate is the current glucose minus the earliest eligible glucose, divided by elapsed minutes. Otherwise it is left blank. This is an endpoint slope, not a fitted regression or a sensor trend-arrow algorithm.
Worked example: a change from 100 to 130 mg/dL over 15 eligible minutes is +2 mg/dL per minute. Negative values indicate a fall. A gap can shorten the window or leave the slope unavailable. The rate chart can show a selected recorded date alone, alongside one other date, or alongside multiple chosen dates. All dates share the same local-clock axis, slope formula, and data-derived gap limit; eligible preceding readings may cross midnight.
An excursion starts at the first reading above 180 after a reading at or below 180, provided the gap is allowed. Its plotted values are changes from that starting reading. The sequence stops at the first subsequent reading at or below 180 (included), before a disallowed gap, or when the next reading would exceed three hours from the start. Only sequences with at least two points are retained; the graph shows the latest ten.
A detected excursion is not a confirmed meal response. Its ending may reflect missing data or the three-hour limit rather than recovery.
Explore: synthetic typical-day comparison
Explore compares September 8, 2026 with the same clock hours in its preceding 7, 14, or 28 generated days, all in UTC. All data are synthetic; no personal files or uploads feed this demonstration. The selected day is never included in its baseline.
Historical days need at least 70% usable adjacent-interval coverage in the selected period. This is an illustrative software rule, not a clinical completeness standard. At each 15-minute clock-time bin, each eligible day contributes one mean value. The median and 25th/75th percentiles are then calculated across distinct days with linear interpolation at (n − 1) × quantile. At least three distinct days are required. The shaded band is the historical middle 50%, not a confidence interval, prediction, or medical target.
Per-bin day counts, exact dates, per-day coverage, exclusions, independent traces, and source readings are available in the comparison. Missing and insufficient bins remain unavailable. Period differences use current minus historical median at the start of each usable interval, weighted by duration, only when both current and historical endpoints exist. The displayed paired observed minutes are the denominator. A 24:00 reading closes the synthetic day and is not another independent day.
The current-day rate remains an adjacent 15-minute backward difference and is linked to the same selected time. Historical rate comparison is not implemented. These descriptive comparisons do not establish significance, causes, or treatment decisions.
Explore: experimental curve-defined segmentation
Clock-time periods remain available. The alternative curve-defined view classifies each usable adjacent interval by (end glucose − start glucose) ÷ elapsed minutes. At the default threshold, rising is at least +0.25 mg/dL/min, falling at most −0.25, and steady strictly between. The visible threshold can be changed to 0.15, 0.25, or 0.50. These are illustrative software conventions, not medical classifications.
Consecutive intervals with the same class form one segment. No smoothing, minimum-duration filter, or short-run merging is applied: one 15-minute interval can form a segment. This keeps brief reversals visible but can fragment noisy readings. Missing endpoints or intervals longer than 15 minutes end a run; no gap is crossed. An isolated reading has no interval to classify. Transition readings can be shared by adjacent runs, but intervals never overlap. Peaks and troughs are not additional overlapping segments.
Each segment shows start and end, observed duration, endpoint glucose change, average rate (change divided by duration), boundary reasons, and every interval’s arithmetic. Observed segment minutes plus excluded gap minutes reconcile to the full day. Historical comparison is recalculated for the selected segment’s same clock window using the documented coverage and day-count rules. This is not shape matching, learned clustering, or evidence of meals, sleep, insulin, or any cause.
5. What this method does not establish
These calculations describe the readings provided. They do not identify meals, measure an insulin dose’s effect, establish causes, or recommend treatment. No minimum multi-day coverage requirement is enforced beyond the three-reading import minimum, so a successfully imported file is not necessarily representative.
The default sample is synthetic and deliberately includes gaps. Explore is a separate synthetic historical-comparison concept with its own controls, described above. Similar Days uses a separate preceding-hour matching implementation; the rules above document My glucose charts, not every analysis across the site.
Clustering and confidence intervals are not implemented by the chart calculations described here and should not be inferred from them. This page documents software behavior; it does not claim medical review, clinical validation, or predictive reliability.