Cost per serving: a small formula (and JS function) for comparing supplement prices

2026-12-02来源 dev.toEnglish

Disclosure: I write for the Health World Web editorial team, which runs the free calculator linked below.

A lower bottle price is not always a lower price per serving. Bottles hold different counts, and labels define a "serving" differently. A bottle with 60 capsules and a 2-capsule serving gives 30 servings. The same bottle with a 1-capsule serving gives 60.

The math is simple enough to write in a few lines.

The formula

total servings = bottles x capsules per bottle / capsules per labeled serving cost per serving = total price / total servings 

Use the final price for that exact quantity, including shipping, tax and discounts, and use the same currency for every option.

A small JavaScript version

function costPerServing({ totalPrice, bottles, perBottle, perServing }) { const servings = (bottles * perBottle) / perServing; return totalPrice / servings; } // Fictional example numbers, not real products const a = costPerServing({ totalPrice: 30, bottles: 1, perBottle: 60, perServing: 2 }); const b = costPerServing({ totalPrice: 36, bottles: 1, perBottle: 60, perServing: 1 }); console.log(a.toFixed(2)); // 1.00 console.log(b.toFixed(2)); // 0.60 

In this made-up case, option A is cheaper per bottle ($30 vs $36) but costs more per serving ($1.00 vs $0.60).

What this does not tell you

Cost per serving compares price only. It says nothing about ingredient amounts, quality, safety or health benefits, and it is not a dosing recommendation. Compare label directions and ingredient amounts separately. Do not change how much you take to lower the cost.

Edge cases the simple formula does not cover: powders, liquids, variable serving ranges, and labels without a capsule or tablet count. Subscription prices that change after the first order are also not covered unless you enter them.

A no-code version

If you do not want to write code, we built a free calculator that does the same arithmetic in the browser. Inputs are not stored and no account is needed: Supplement Cost Per Serving Calculator. The starting numbers in it are fictional examples.

Before buying, a testing report is a separate check worth reading. It should match the exact product and lot, and it does not prove a health benefit.

原文:https://www.a8q9.cn/en/article/cost-per-serving-a-small-formula-and-js-function-for-comparing-supplement-prices-988ecb.html

相关文章