How Vialkeeper works out its numbers

Every figure in the app comes from arithmetic on numbers you entered. Vialkeeper has no drug database, no preset doses and no built-in half-lives — it does not know what any substance is, and it never decides what your dose should be. This page states each formula so you can check it yourself.

Concentration

For a vial you reconstitute yourself, concentration is the amount of powder divided by the volume of liquid you added:

concentration (mg/mL) = vial amount (mg) ÷ diluent volume (mL)

For a vial that came pre-mixed, Vialkeeper does not derive anything — it uses the strength you typed from the label, because that is a fact about the product rather than something to calculate.

Tablets have no concentration; they are handled by strength alone.

How much to draw

Volume is dose divided by concentration:

draw volume (mL) = dose (mg) ÷ concentration (mg/mL)

That is the whole calculation. It is the same arithmetic printed on the vial carton, and it is deliberately the only thing the app does with your dose.

Syringe graduations, and why the number sometimes changes

A syringe can only be read to the lines printed on it. Vialkeeper treats 0.5 mL and 1 mL barrels as marked every 0.01 mL, and 2 mL and 3 mL barrels as marked every 0.1 mL. If the volume you need does not land on a line, the app says so, and shows the nearest line below it:

shown volume = largest graduation mark ≤ exact volume

It always rounds down, never up, so the app can never quietly put more drug in the syringe than you planned. When rounding down changes the amount delivered, the card tells you the milligrams you would actually be giving rather than hiding the difference. A barrel that cannot hold the volume at all is marked as too small instead of being shown full.

Tablets

Tablet count is dose divided by the strength of one tablet:

tablets = dose (mg) ÷ tablet strength (mg)

Doses are entered in milligrams throughout the app, and the tablet count is derived from that, so a schedule or a taper means the same thing whether it is a tablet or an injection. If the result is not a whole or a half tablet, Vialkeeper flags it rather than rounding — splitting a tablet into thirds is usually not something you can do accurately, and some tablets should not be split at all.

Vial and bottle inventory

Inventory is tracked in milligrams, because milligrams describe powder, oil and tablets equally well. Doses are drawn from the oldest open container first, and the volume or tablet count you see is that milligram balance converted back for display.

remaining (mg) = container total (mg) − sum of doses drawn from it (mg)

Days of supply and reorder dates are projections from your current schedule. They assume you keep taking what you are taking now, and they are only as good as that assumption.

The estimated amount chart

This is the one number in Vialkeeper that is a model rather than arithmetic, and it should be read as an illustration, not a measurement.

It uses a one-compartment first-order model: each dose you have logged decays on the half-life you entered, and the curve is the sum of what is left of all of them. The relationship between half-life and the elimination rate constant is the standard one, t½ = 0.693/k, which rearranges to:

kₑ = ln2 ÷ half-life
remaining fraction after t hours = e^(−kₑ · t)

If you also give an absorption half-life — worth doing for anything injected into a depot, where the drug is not all in circulation the moment it goes in — the app uses the Bateman function instead, described as quantifying “a first-order invasion (rate constant kₐ) to, and a first-order elimination (rate constant kₑ) from, a one-compartment body model” (Garrett, 1994):

fraction = (kₐ ÷ (kₐ − kₑ)) · (e^(−kₑ · t) − e^(−kₐ · t))

What this chart is not:

  • It is not a blood concentration. Without a volume of distribution there is no mg/L, so the axis is an amount in milligrams, not a level.
  • It is not personalised. The model assumes one compartment, complete bioavailability, and no variation in clearance, metabolites or interactions between people.
  • It has not been validated against blood work, yours or anyone else’s, and it is no substitute for a lab test.
  • It is not a suggestion. It describes what has already been taken. Nothing in it indicates what to take next or when.

Half-lives are always yours to enter. Vialkeeper ships no half-life values, because published figures vary between sources and populations and picking one for you would be exactly the kind of decision this app refuses to make.

Weight

The line through the weight chart is a 7-day moving average — each point is the mean of the available readings in the week ending that day. It exists because day-to-day weight moves with water, food and time of day far more than with anything you are tracking, and a smoothed line makes the underlying direction legible without hiding the individual readings, which stay on the chart.

trend(day) = mean of readings in the 7 days ending that day

Rounding and units

Doses are stored and computed in milligrams. Where you enter micrograms or units, they are converted once on entry and the milligram value is what everything else uses. Displayed numbers are rounded for legibility; the stored values are not, so rounding never accumulates across a schedule.

What Vialkeeper is not

Vialkeeper is not a medical device and does not diagnose, treat, cure or prevent any medical condition. It does not provide medical advice and it does not recommend doses.

It is a record-keeping and arithmetic tool. Confirm every dose with your prescriber or pharmacist before you act on it, and use it only for substances that are legally prescribed to you or legally obtained where you live.

You can run any of this yourself in the dose calculator, which needs no account.

Worked examples: reading a U-100 syringe · units, mL, mg and mcg · how long a vial lasts.

Questions about any of this, or think something here is wrong? Email hello@vialkeeper.com — corrections to the maths are genuinely welcome.