Skip to content

Running a business

How to calculate cost of goods sold and set your selling price

The COGS formula per product and per period, how to price from a target margin, the difference between markup and margin, and how to account for platform fees.

4 min readWritten by the Fiantra Advisory team

"We charge this much because that's what competitors charge." Business owners say it all the time, and it's often why a business is busy but barely profitable.

A healthy price starts with one number: cost of goods sold (COGS). This article explains how to calculate it and then use it to set your selling price.

What is cost of goods sold?

COGS is the total cost directly tied to the products you sell. For a business that makes things (food, clothing, crafts), it usually includes:

  • Materials: flour, fabric, wood and other main ingredients.
  • Packaging: boxes, bags, labels, stickers.
  • Direct labour: wages of the people who make the product.
  • Other production costs (overhead): gas, electricity used in production, equipment depreciation.

Costs that aren't directly part of production, such as office rent, admin wages and advertising, are not COGS. They're operating expenses in your profit and loss statement.

How to calculate COGS per product

The easiest way is to work out the cost of one batch and divide it by the number of products it makes. Here's a tray of brownies cut into 20 pieces:

COGS per piece · Brownies · 1 tray (20 pieces)Illustrative example
ComponentPer trayPer piece
MaterialsRp 120,000Rp 6,000
PackagingRp 30,000Rp 1,500
Direct labourRp 50,000Rp 2,500
Production gas & electricityRp 20,000Rp 1,000
COGSRp 220,000Rp 11,000

These figures are an illustrative example for learning, not client data.

How to calculate COGS for a retail business

For a shop or reseller that buys goods and sells them on, COGS is calculated per period:

COGS = opening inventory + purchases − closing inventory

COGS for one month · Household goods shopIllustrative example
ItemAmount
Opening inventory (1 October)Rp 15,000,000
Purchases during October+ Rp 40,000,000
Closing inventory (31 October)− Rp 18,000,000
COGS for OctoberRp 37,000,000

Closing inventory comes from a stock count, which means physically counting what's left at month-end. Without one, COGS is only an estimate, and losses from damaged or missing stock never show up.

Setting your price from a target margin

Once you know your COGS, decide what share of the selling price you want to keep as gross profit (your margin). The formula:

Selling price = COGS ÷ (1 − target margin)

With a brownie COGS of Rp 11,000 and a 50% target margin:

Selling price = Rp 11,000 ÷ (1 − 0.5) = Rp 22,000 per piece.

That Rp 11,000 of gross profit is what pays the rent, admin wages and marketing, with a net profit left over.

Markup vs margin (a common trap)

Many owners "add 50%" to cost and assume their margin is 50%. In fact:

ApproachCalculationPriceActual margin
50% markupRp 11,000 + 50% of costRp 16,500about 33%
50% target marginRp 11,000 ÷ (1 − 0.5)Rp 22,00050%

Markup is based on cost; margin is based on the selling price. The gap is big, and it's often why a business feels very profitable when it isn't.

Accounting for platform fees and discounts

If you sell through a marketplace or delivery app, a commission comes out of the selling price. Say the commission is 20% (check your platform's actual terms), and you still want a 50% margin on what you receive:

  1. Amount you need to receive = Rp 11,000 ÷ (1 − 0.5) = Rp 22,000.
  2. Price on the platform = Rp 22,000 ÷ (1 − 0.2) = Rp 27,500.

The same goes for regular discounts and free-delivery promos you pay for: build them into the calculation instead of hoping they'll cover themselves.

When should you recalculate COGS?

  • When material prices rise or fall noticeably.
  • When you change supplier or packaging.
  • When you add production staff.
  • At least every three months, as a habit.

The takeaway: calculate COGS per product (or per period for retail), price from a target margin (not a markup), then include commissions and discounts. If you'd like to work through costing and pricing for your own business, join one of our MSME finance classes.

Frequently asked questions

What is cost of goods sold (COGS)?
Cost of goods sold is the total cost directly tied to the products you sold, such as materials, packaging, direct labour and other production costs. It's used to set selling prices and to calculate gross profit.
What is the COGS formula for a retail business?
For a business that buys and resells goods, COGS for a period = opening inventory + purchases − closing inventory. Closing inventory comes from a physical stock count at the end of the period.
What is the difference between markup and margin?
Markup is calculated on cost, while margin is calculated on the selling price. A product that costs Rp 10,000 and sells for Rp 15,000 has a 50% markup but only about a 33% margin. Use margin when you set profit targets.

Want hands-on help?

If this article sounds like your business, let's have a quick chat.

All articles

Start learning

Start with the part that confuses you most.

Tell us your level and topic on WhatsApp, and we'll help you schedule your first session.