Calculate the price of any weight in grams from a price per gram, 100 g, kg, oz or lb, or find the price per gram and how many grams a budget buys.

Prices use USD ($). Ounces and pounds are avoirdupois mass; taxes, fees and selling increments are excluded.

Calculator Functions

FunctionWhat it doesWhat it requires
Total priceFinds the price of a weight from its unit priceRequires the weight and the unit price
Price per gramFinds the price per gram from a total price and a weightRequires the total price and the weight
Purchasable weightFinds how many grams a budget buys at a unit priceRequires the total price or budget and the unit price
Price for another weightConverts the price of one weight to the price of a different weightRequires the known weight, the known price and the new weight

Weight is entered in g, kg, oz or lb, and the unit price per g, per 100 g, per kg, per oz or per lb. The first three functions show prices in US dollars and also list the price per gram, per 100 g, per kilogram, per ounce and per pound. Price for another weight takes a plain number and returns the answer in the same currency.

Grams to Price Formulas

TP = G × PPG [1]
TPTotal price
GWeight in grams
PPGPrice per gram

A price per gram is a unit price, the cost for one unit of measure [1], so the total is the number of grams times that price. Weights in other units are converted to grams first: 1 kg = 1,000 g, 1 oz = 28.3495 g and 1 lb = 453.592 g [2].

Total price

150 g at $0.75 per gram costs 150 × 0.75 = $112.50. The total is rounded once, to the nearest cent.

Price per gram

PPG = TP ÷ G

A 200 g pack that costs $7.50 is 7.50 ÷ 200 = $0.0375 per gram, which is $3.75 per 100 g or $37.50 per kilogram.

Purchasable weight

G = budget ÷ PPG

A $20 budget at $2.50 per gram buys 20 ÷ 2.50 = 8 g. The unit price has to be above zero.

Price for another weight

new price = known price ÷
known weight × new weight

Both weights are in grams after conversion. If 3.5 g costs 250, the price per gram is 250 ÷ 3.5 = 71.428571 and 1 g costs 71.43. If a 500 g block of butter costs 11, the 75 g a recipe needs costs 11 ÷ 500 × 75 = 1.65.

Limits of This Estimate

  • The price is assumed to be the same for every gram. Bulk discounts, minimum charges and fixed selling sizes are not modeled.
  • Taxes, fees and shipping are left out, and no currency is converted.
  • Ounces and pounds are avoirdupois units, the ones used for food and most goods. Gold and silver are priced by the troy ounce, which is 31.1035 g [2], so convert precious-metal weights to grams before entering them.

Sources

  1. NIST Special Publication 1181 (2025), Unit Pricing Guide: unit pricing as the cost per unit of measure
  2. NIST, Guide for the Use of the International System of Units (SP 811), Appendix B.8: the avoirdupois ounce and pound, and the troy ounce, in grams