Small Business Finance

How to Calculate COGS (HPP) for a Small Business in Indonesia: Formulas, Examples and Pricing

A fictional coffee stall and grocery shop: cost one cup, set a price without mixing up margin and markup, then calculate monthly COGS with stock.

By Budgetku Team

11 min read
Illustration of the cost of one fictional iced coffee: ingredients and packaging Rp10,330, labour Rp1,500 and production costs Rp425, Rp12,255 in total, sold at Rp22,000.
In this article

Cost of goods sold (COGS), known in Indonesia as HPP (harga pokok penjualan), is the direct cost of the goods you actually sold. You need it for two things: setting a selling price for each product, and working out your profit each month. Get it wrong and you can underprice without noticing, while your monthly report shows more profit than you really made.

This guide uses two fictional Indonesian businesses. The first is an iced coffee stall, used to calculate the cost of one cup and then a selling price. The second is a neighbourhood grocery shop, used to calculate monthly COGS with stock taken into account.

What is COGS?

COGS is the total cost tied directly to the goods sold in a period. The key word is sold. Ingredients bought this month that are still on the shelf are not COGS yet. They become COGS when the product made from them is sold.

On a profit and loss statement, COGS is the first deduction from revenue:

Gross profit = revenue − COGS

Gross profit then has to cover everything else, such as rent, advertising and salaries, before anything is left as net profit.

What goes into COGS?

It depends on the type of business:

  • Trading (shops, resellers, wholesalers): the purchase price of the goods plus the cost of getting them to you, ready to sell.
  • Production (food, drinks, crafts, garments): raw materials, packaging, the labour of the people who make the product, and other production costs such as gas, electricity for machines and depreciation of production equipment.
  • Services: usually no COGS in the sense of goods. The closest equivalent is the direct cost of each job, such as consumables or a technician's pay per project.

What is not COGS: the cost of selling and running the business, such as advertising, delivery to customers, commission charged by delivery apps or marketplaces, admin salaries and rent for a shop front. Your price still has to cover these, but they are recorded as operating expenses.

Many small businesses use a simple version, COGS = materials + packaging only. That is fine as long as you stay consistent from month to month. For setting prices, use the full version that also includes direct labour and production costs, so wages and gas are not forgotten.

Two COGS formulas you need

1. COGS per unit, for setting prices:

COGS per unit = materials per unit + packaging + direct labour per unit + other production costs per unit

Materials per unit come from the recipe. If 1 kg of coffee costs Rp200,000 and one cup uses 18 grams, the coffee in each cup costs Rp200,000 ÷ 1,000 × 18 = Rp3,600.

2. COGS for a period, for the monthly report:

COGS = opening stock + net purchases − closing stock

Net purchases are purchases plus inbound shipping, minus returns and supplier discounts. This formula exists because not everything bought this month is sold this month.

Example 1: the cost of one iced coffee

“Kopi Teras” is a fictional stall selling iced palm sugar coffee with milk, about 1,200 cups a month. Here are its recipe quantities and costs per cup.

ItemCoffeePurchase priceRp200,000 per kgPer cup18 gCost per cupRp3,600
ItemUHT milkPurchase priceRp20,000 per litrePer cup150 mlCost per cupRp3,000
ItemLiquid palm sugarPurchase priceRp60,000 per litrePer cup25 mlCost per cupRp1,500
ItemIcePurchase priceRp10,000 per bag (20 cups)Per cup1/20 bagCost per cupRp500
ItemMaterials subtotalPurchase price—Per cup—Cost per cupRp8,600
ItemWaste allowance, 5% of materialsPurchase price—Per cup—Cost per cupRp430
ItemCup, lid and strawPurchase price—Per cup1 setCost per cupRp1,300
ItemSimple COGSPurchase price—Per cup—Cost per cupRp10,330

The waste allowance covers ingredients that never reach a customer: spilt milk, coffee used to calibrate the machine, drinks remade. The 5% here is only an example. For your own business, compare a month of ingredient purchases with what you sold to find your real waste.

Then add labour and other production costs. Both are paid monthly, so divide them by the cups sold in a month:

ItemSimple COGSPer month—Per cup (÷ 1,200)Rp10,330
ItemPart-time baristaPer monthRp1,800,000Per cup (÷ 1,200)Rp1,500
ItemElectricity and water for the machinesPer monthRp360,000Per cup (÷ 1,200)Rp300
ItemDepreciation of machine and grinder (Rp7,200,000 ÷ 48 months)Per monthRp150,000Per cup (÷ 1,200)Rp125
ItemFull COGS per cupPer month—Per cup (÷ 1,200)Rp12,255

So the full cost of one Kopi Teras iced coffee is about Rp12,255.

One caveat: the barista's pay and depreciation are fixed each month. If sales fall to 800 cups, the labour share per cup rises from Rp1,500 to Rp2,250. Recalculate the unit cost when your volume changes a lot.

From COGS to a selling price

There are two ways to express profit per product, and they are often confused:

  • Margin is based on the selling price: (price − COGS) ÷ price.
  • Markup is based on cost: (price − COGS) ÷ COGS.

If you are aiming for a particular margin, the price formula is:

Selling price = COGS ÷ (1 − target margin)

Target margin40%CalculationRp12,255 ÷ 0.6Minimum priceRp20,425RoundedRp20,500
Target margin50%CalculationRp12,255 ÷ 0.5Minimum priceRp24,510RoundedRp25,000
Target margin60%CalculationRp12,255 ÷ 0.4Minimum priceRp30,638RoundedRp31,000

Always round a minimum price up. Rounding down, say Rp24,510 to Rp24,500, puts the margin just below your target.

Kopi Teras settles on Rp22,000, in line with other stalls nearby. At that price, gross profit is Rp9,745 per cup: a 44.3% margin and a 79.5% markup.

Why does the difference matter? Suppose the owner thinks “I'll take 50% profit” and calculates Rp12,255 × 1.5 = Rp18,383. That is a 50% markup, but the margin is only 33.3%. Gaps like this are a common reason a busy business still feels as if it earns nothing.

Selling through a delivery app. The app's commission is not COGS, but it comes off the selling price, so it has to be in the formula:

Selling price = COGS ÷ (1 − target margin − commission rate)

With a 40% target margin and an example commission of 20%, the price is Rp12,255 ÷ 0.4 = Rp30,638, rounded up to Rp31,000. The commission rate here is only an illustration; check the rate in your own partner app.

Check your break-even point

The break-even point is the level of sales at which every cost is covered exactly: no profit yet, but no loss either. To find it, split your costs in two:

  • Variable costs rise and fall with the number of cups sold. For Kopi Teras these are ingredients, waste and packaging, the simple COGS of Rp10,330 a cup.
  • Fixed costs are paid however many cups you sell. The barista's pay, machine electricity and depreciation belong here. Full COGS spreads them over each cup, but for break-even they count in full each month.
Fixed costs per monthPart-time baristaAmountRp1,800,000
Fixed costs per monthElectricity and water for the machinesAmountRp360,000
Fixed costs per monthDepreciation of machine and grinderAmountRp150,000
Fixed costs per monthStall rentAmountRp2,500,000
Fixed costs per monthSocial media adsAmountRp500,000
Fixed costs per monthOwner's payAmountRp3,000,000
Fixed costs per monthTotal fixed costsAmountRp8,310,000

Each Rp22,000 cup leaves Rp22,000 − Rp10,330 = Rp11,670 towards the fixed costs. This is called the contribution margin.

Break-even = fixed costs per month ÷ contribution margin per cup

For Kopi Teras, Rp8,310,000 ÷ Rp11,670 = 712.1, rounded up to 713 cups a month, or about 24 a day. At 1,200 cups, about Rp5,694,000 is left after all costs.

Do not use full COGS for break-even. Dividing the costs outside full COGS (Rp6,000,000) by the gross profit per cup (Rp9,745) gives 616 cups. But at 616 cups the barista, machine electricity and depreciation are still paid in full, so Kopi Teras would actually lose about Rp1.1 million.

Note that the owner's pay is included on purpose. Many owners work every day without paying themselves, so the business looks profitable when it has not yet paid for their time.

Example 2: monthly COGS for a grocery shop

A small grocery shop does not cost every packet of noodles or bottle of cooking oil one by one. The period formula is more practical. “Toko Bu Fulanah” is a fictional shop that counts its stock on the last day of every month.

ItemOpening stock (counted)AmountRp18,000,000
ItemPurchases of goods for saleAmountRp42,000,000
ItemInbound shippingAmountRp600,000
ItemDamaged goods returned to suppliersAmount(Rp400,000)
ItemNet purchasesAmountRp42,200,000
ItemGoods available for saleAmountRp60,200,000
ItemTaken for the owner's householdAmount(Rp300,000)
ItemClosing stock (counted)Amount(Rp16,500,000)
ItemCOGS for the monthAmountRp43,400,000

With sales of Rp52,000,000, Toko Bu Fulanah's gross profit is Rp8,600,000, a 16.5% gross margin.

Two things in this example are easy to miss:

  • Goods taken home. Noodles, sugar or soap used by the owner's family were not sold, so they do not belong in COGS. Value them at purchase price and take them out of the calculation.
  • Falling stock. Closing stock is Rp1,500,000 lower than opening stock, so part of what was sold this month was bought last month. If COGS were taken as net purchases only, gross profit would show Rp9,800,000, which is Rp1,200,000 more than it really is. The gap is the Rp1,500,000 fall in stock, which is left out, minus the Rp300,000 of household goods, which is wrongly counted as a cost.

A few tips for counting stock:

  1. Count on the same day each month, for example the last day after closing.
  2. Value stock at purchase price, not selling price. Using selling prices makes closing stock too high and COGS too low.
  3. Take damaged and expired goods out and note their value. If it is large month after month, look at how goods are stored or bought.

Common COGS mistakes

  1. Forgetting small items and packaging. Sugar, straws, bags, stickers and rubber bands look trivial but can add hundreds of rupiah per product.
  2. Using old purchase prices. If ingredient prices rise and your costing does not, your margin shrinks quietly. Update it whenever a supplier changes prices, or at least monthly.
  3. Ignoring waste. Spilt, failed or expired ingredients were still paid for.
  4. Leaving out your own labour. If you make the product, your time has a value. Include it as labour in full COGS or as owner's pay in the break-even check.
  5. Valuing stock at selling price. COGS comes out too low and profit too high.
  6. Mixing in personal shopping. Household groceries paid from business money make COGS look bigger.
  7. Forgetting commission and delivery when pricing. Neither is COGS, but both reduce the money you receive.

Working out COGS from your Budgetku records

You still count stock and cost each product yourself, using the formulas above. Budgetku, a money app for small businesses, helps with the part that is most often messy, the purchase figures:

  1. Create separate expense categories, such as Raw materials, Packaging, Goods for sale and Inbound shipping. Every expense needs a category, so purchases are grouped from the moment you record them.
  2. Record every purchase and attach a photo of the receipt. Receipt attachments are available on every plan, including Free.
  3. Record supplier refunds for returns as income in their own category, so they are easy to subtract from purchases.
  4. Record sales as income, for example as a daily total.
  5. At the end of the month, open Reports and pick a one-month date range. Spending by category gives the purchase total for the period formula.

From the Pro plan, transactions and reports can be exported to CSV, or synced to Google Sheets, if you prefer to finish the calculation in a spreadsheet.

FAQ

What is the difference between COGS and the selling price?

COGS is the direct cost of making or buying the goods that were sold. The selling price is what the customer pays. The difference is gross profit, which still has to cover other costs such as rent and advertising.

Do employee wages count as COGS?

The pay of people who make the product, such as a barista or cook, can go into full COGS. Cashier, admin or courier wages are operating expenses. What matters is doing it the same way every month.

Does rent count as COGS?

Rent for a kitchen or workshop used only for production can be treated as a production cost. Rent for a shop or stall where you sell is an operating expense, covered through the break-even check as in the Kopi Teras example.

What is a good margin?

There is no single figure that suits every business. Two checks are more useful: whether the margin per product covers your monthly costs at realistic sales, and whether the price still makes sense next to competitors around you.

How often should I recalculate COGS?

Whenever ingredient or supplier prices change noticeably, and at least once a month. Period COGS is calculated monthly, together with your stock count.

Do service businesses have COGS?

Usually not in the form of goods. A service business can still work out the direct cost of each job, such as consumables and pay per project, and use the same margin formula to set its rates.

Start tracking your money in Budgetku

The Free plan is free forever, no credit card needed: unlimited accounts and transactions, monthly budgets, and cash flow reports.