How to Calculate COGS (HPP) for Your Products, with Rupiah Examples

COGS is the real cost of every item you sell. Learn what goes into it, the per-unit and per-period formulas, and how to use it to set your selling price.

By · reviewed before going live

Business finance7 min read
An equation made of objects: a sack of material, a jar and a packing box add up to a price tag reading HPP.

Summary

  • COGS (cost of goods sold, HPP in Indonesian) is every cost of buying or making the goods you sold, not just the supplier’s price.
  • For resellers, cost per unit = purchase price + inbound shipping and other landing costs, divided by the number of sellable items.
  • For makers, it covers raw materials, production labour and production overhead, divided by the units that pass quality checks.
  • COGS for a period = opening inventory + purchases − closing inventory.
  • Set your selling price from COGS with the margin formula, not just “COGS plus a percentage”.
Contents

Plenty of sellers know their revenue but not the exact cost behind each item sold. Prices end up guessed, discounts are given without calculation, and month-end profit is smaller than expected. This article shows how to calculate COGS for resellers and makers, with rupiah examples and tables, and how to use it to set prices.

What COGS is and why it is more than the purchase price

In Indonesia, COGS is called HPP, short for harga pokok penjualan. Traders often just call it the cost of the goods sold. It includes every cost needed to get a product ready for sale.

The supplier’s price is only one part. Shipping from the supplier to your storeroom, loading and unloading, and defective items that cannot be sold all raise the cost per item. Leave them out and every product looks more profitable than it is.

What usually does not go into COGS are operating costs: rent, admin wages, electricity, ads, and shipping to buyers that the store pays. These still reduce profit, but they are recorded as expenses, not product cost. Keeping them apart lets you answer two different questions: is the product profitable, and is the store as a whole profitable?

Cost per unit for resellers

For a reseller buying finished goods, the formula is simple: add up every cost of getting the goods, then divide by the number of sellable items.

Example: you buy 50 small bottles of perfume at Rp40,000 each, and shipping from the supplier costs Rp150,000.

ItemCalculationAmount
Purchase price50 × Rp40,000Rp2,000,000
Shipping from supplierOne deliveryRp150,000
Total cost—Rp2,150,000
Cost per bottleRp2,150,000 ÷ 50Rp43,000

If 2 bottles leak and cannot be sold, you divide by 48 instead, and the cost per bottle rises to about Rp44,800. Damaged items do not make the cost disappear; the remaining items carry it.

Cost per unit for makers

Makers count three groups of cost: raw materials, labour directly tied to production, and production overhead (supporting costs such as sewing machine electricity, thread or workshop rent). Here is one batch of 100 printed T-shirts:

Batch costDetailsAmount
FabricMain materialRp3,000,000
Screen printingPrinting for 100 piecesRp1,000,000
Sewing100 × Rp15,000Rp1,500,000
Labels and bagsSupporting materialsRp300,000
Material shippingFrom fabric shop to workshopRp200,000
Total batch cost—Rp6,000,000

If all 100 pieces are sellable, cost per shirt is Rp60,000. But production nearly always has defects. Say 4 pieces have printing errors. The batch still cost Rp6,000,000, but only 96 can be sold, so cost per shirt becomes Rp6,000,000 ÷ 96 = Rp62,500. That Rp2,500 gap per piece looks small, yet across 96 pieces it adds up to Rp240,000.

COGS for a period

Besides per unit, COGS is also calculated per period, such as a month, to find gross profit. The common formula:

COGS for the period = opening inventory + purchases during the period − closing inventory
LineValue
Opening inventory, 1 October (at cost)Rp5,000,000
Purchases during OctoberRp12,000,000
Goods available for saleRp17,000,000
Closing inventory, 31 October (physical count)Rp4,000,000
October COGSRp13,000,000

If October net sales were Rp20,000,000, gross profit is Rp7,000,000, or 35% of sales. Closing inventory must come from a physical count or reliable stock records. If it is guessed, COGS and gross profit are guesses too. Counting stock is covered in how to manage online store inventory.

When purchase prices change: average or FIFO

Supplier prices rarely stay put. Say you still have 20 bottles costing Rp40,000, then buy 30 more costing Rp46,000. There are two common ways to cost the next items sold:

  • Weighted average. All units are averaged: (20 × Rp40,000 + 30 × Rp46,000) ÷ 50 = Rp2,180,000 ÷ 50 = Rp43,600 per bottle. The average is recalculated every time goods come in.
  • FIFO (first in, first out). The earliest units are treated as sold first. The first twenty bottles sold cost Rp40,000, the rest Rp46,000.

Sell 25 bottles and COGS is Rp1,090,000 under weighted average (25 × Rp43,600), or Rp1,030,000 under FIFO (20 × Rp40,000 + 5 × Rp46,000). Over time the totals match; what differs is when the gap shows up in your reports. Averaging is easier for small stores, while FIFO is more precise when prices swing sharply. Pick one and stick with it.

From COGS to price: margin vs markup

These two terms get mixed up. Markup is calculated on COGS, while margin is calculated on the selling price. With a shirt cost of Rp62,500:

MethodCalculationSelling priceActual margin
40% markupRp62,500 × 1.4Rp87,500About 28.6%
40% target marginRp62,500 ÷ (1 − 0.4)About Rp104,200, rounded to Rp105,000About 40.5%

If you want 40% of each sale to be gross profit, use the margin formula. Then remember gross profit still has to cover operating expenses and, on a marketplace, platform fees. Those are compared in marketplace seller fees vs your own store.

Common COGS mistakes

  • Using only the purchase price and forgetting inbound shipping and handling.
  • Dividing by units produced instead of units that can be sold.
  • Putting ads and admin wages into COGS, which makes product gross profit look worse than it is.
  • Using an old purchase price after the supplier has raised it.
  • Never counting stock, so closing inventory is only an estimate.
  • Calculating COGS once and not updating it for months.

COGS on Fisell

On Fisell, every product has a Cost field for the purchase or production cost per unit. When you record stock buying under Purchases, Extra costs such as shipping and handling are split across items by value and become part of their cost. Cost is tracked as a weighted average, and each item’s cost is frozen when an order’s payment is confirmed, so Gross profit by product under Finance does not shift when purchase prices rise later. For makers, Production calculates cost per unit from materials, labour and the number of units actually finished; the Free plan includes 5 batches a month.

Want to try it with your own products? Create a Fisell account, or first read how to separate business and personal finances so personal money does not blur your profit figures.

Frequently asked questions

What is the simplest COGS formula?
Per unit: the total cost of buying or making the goods divided by the number of sellable items. Per period: opening inventory + purchases − closing inventory.
Is shipping to buyers part of COGS?
Usually not. Shipping from the supplier to you goes into COGS, while shipping to buyers that the store pays is a selling expense. If the buyer pays shipping, it is not your cost at all.
Is packaging part of COGS?
Packaging that is part of the product, such as bottles, labels or product boxes, belongs in COGS. Mailer bags and tape are usually treated as shipping costs. Choose one approach and keep it so months can be compared.
What is an ideal margin?
No single figure fits every product. Your margin must cover operating expenses, platform fees if any, and goods that do not sell. Compare with market prices for similar products too.