Cost of goods sold calculator for online stores
Calculate cost of goods sold, gross profit and margin for your reporting period.
Cost of goods sold
$124,200
Stock available
$168,600
For the entered reporting period.
Profit from these sales
Gross profit
$82,800
Gross margin
40%
Before operating expenses and tax.
Cost of goods sold: $124,200. Gross profit: $82,800. Gross margin: 40%.
The cost of goods sold formula
Cost of goods sold (COGS) is the stock cost recognised for goods sold during a reporting period. Calculate it as opening inventory plus purchases minus closing inventory.
Opening inventory is stock held at the start. Purchases are the net cost of stock acquired during the period. Closing inventory is the cost of stock still held at the end.
Adding opening inventory and purchases gives the stock available for sale. Subtracting closing inventory removes the stock you still hold from the period’s cost.
Use cost values throughout. Incorrect: subtracting the closing stock’s retail ticket value from purchases at cost. Correct: subtracting its cost value on the same basis as opening stock.
Use the same reporting period for every entry. This calculator assumes the stock balances and purchase total reconcile without separate stock adjustments.
It stops if closing inventory exceeds opening inventory plus purchases. Reconcile missing purchases, transfers or stock-count errors before using that result.
What to include in cost of goods sold
For an online store, inventory cost includes the net product price and costs of bringing stock to its location and condition.
AASB 102 Inventories includes directly attributable transport and handling, import duties and taxes you cannot recover. Deduct trade discounts and rebates.
- Include inbound freight from the supplier to your stock location and import duties in the purchase total.
- Count each cost once. A landed purchase total already containing freight needs no second freight addition.
- Keep advertising, payment-processing fees and outbound customer delivery out of this inventory-cost calculation.
- Exclude ordinary storage and administration that do not bring stock to its present location and condition.
Selling costs are excluded from inventory cost under AASB 102. Track outbound delivery separately when your reports group fulfilment costs under cost of sales.
Exclude recoverable tax from inventory cost and use a consistent tax basis for sales. Ask your accountant or registered tax agent about treatment and stock adjustments.
Cost of goods sold vs cost of sales and expenses
Cost of goods sold is an expense recognised when the related goods are sold. Unsold inventory remains an asset, subject to the applicable valuation rules.
Cost of sales often means the same stock expense in a retail report. A broader cost-of-sales grouping can also contain other direct selling or service costs.
Check the accounts included in your report before comparing it with this calculator. A different grouping changes the gross profit shown, even when the business’s total costs stay the same.
Gross profit equals sales minus cost of goods sold. Gross margin equals gross profit divided by sales, multiplied by 100. The government’s profit and loss guide separates stock cost from operating expenses when calculating profit.
Operating expenses such as marketing and office administration reduce the profit left after gross profit. A positive gross profit therefore does not establish a net profit.
Leaving sales blank still calculates COGS. Entering zero sales shows a gross loss where stock cost is positive, while the margin remains undefined.
A worked example
A fictional online homewares store starts a quarter with $52,800 of inventory at cost. Its net purchases total $109,200, with $5,100 inbound freight and $1,500 import duties.
Those costs make the purchase entry $115,800. Adding opening stock gives $168,600 available for sale. A closing stock count valued at cost gives $44,400 still held.
Cost of goods sold is $52,800 plus $115,800 minus $44,400, which equals $124,200. The store records $207,000 of net sales for the quarter.
Gross profit is $207,000 minus $124,200, or $82,800. Dividing $82,800 by $207,000 gives a 40% gross margin. These are the calculator’s starting values.
Reset example restores those entries. Monetary results show whole dollars, with positive amounts below the rounding threshold shown as Less than $1. The calculation keeps cents.
Before adding COGS to your profit and loss statement, reconcile the stock count and purchase records. This arithmetic tool does not determine accounting or tax treatment.