How this calculator works
The cost of a recipe is the cost of the ingredients you actually use, not the cost of every package you brought home. Cost per serving is that recipe cost divided by the number of servings the dish makes. This calculator starts from the way groceries are sold: a price on a package of a given size, and a smaller amount of that package that goes into the pot.
For each ingredient, the math is package price × (amount used ÷ package size), after the amount used has been converted into the same unit as the package. If chicken thighs are $9.98 for 2.5 pounds and the recipe uses 1.5 pounds, that line costs $9.98 × (1.5 ÷ 2.5) = $5.99. If a 16.9-fluid-ounce bottle of oil is $8.99 and you use 2 tablespoons, those 2 tablespoons are 1 fluid ounce, so the line is $8.99 × (1 ÷ 16.9) ≈ $0.53. Add the lines, then divide by servings.
Units have to be convertible. Cups, tablespoons, teaspoons, fluid ounces, pints, quarts, liters, and millilitres are all volume. Pounds, ounces, kilograms, and grams are all mass. “Each” is a count, for eggs or onions sold by the piece. The calculator will convert inside one of those systems and will refuse to convert across them. A cup of flour does not weigh the same as a cup of water, so there is no honest general conversion from cups to grams without a density for that ingredient. If your package is labeled in grams and your recipe is in cups, weigh the amount you use or look up a density you trust and enter both sides in the same system.
The volume factors are the official US customary equivalents (for example, 1 cup = 236.5882365 millilitres, 1 tablespoon = 14.78676478125 millilitres). Mass uses 1 pound = 453.59237 grams and 1 ounce = 28.349523125 grams. Those are fixed relationships, not kitchen-rounding.
Tiny ingredients such as salt, baking powder, or a pinch of spice can be included if you want a complete number, or left off if you would rather treat them as a pantry staple already paid for. Either approach is fine if you are consistent when you compare two recipes. Leftovers from a package you will use in another meal should not be charged in full to this one; only the amount used belongs on the line.
Waste and trim are worth a short mention even though they are not a separate field. If you buy a cut that is 20% bone or peel you will not serve, the edible portion is smaller than the amount you paid for. You can handle that by entering the weight you paid for as the amount used, or by raising the package price mentally to reflect yield. The more honest match for “cost per serving of edible food” is to count the trim as used.
Scaling is linear: a batch half again as large uses 1.5 times each ingredient and costs 1.5 times as much. In real kitchens, salt, spice, and some thickeners do not always scale perfectly, and a larger pan can change evaporation. Treat a scaled cost as a solid estimate, then adjust when you cook. The sample rows in the form (chicken, rice, and oil) are example figures so you can see the arithmetic; replace them with your own prices.
All of the arithmetic runs in your browser. The tool does not plan a week of meals or build a grocery list. When you want those, a meal-planning spreadsheet is the better next step.