All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us
Cost of Goods Sold Explained: COGS and Profit

Cost of Goods Sold Explained: COGS and Profit

October 25, 2026 Reading time: 17 minutes 5 views

For cost of goods sold explained in plain terms, follow the inventory that a business sells during a set period. Begin with stock on hand, add purchases or production, and take away what remains unsold at the end. The amount left is COGS. It comes off revenue before gross profit is calculated, and it is separate from both sales revenue and the operating costs of running the business.

What does cost of goods sold mean?

COGS tracks the cost of inventory as it moves through the business. Starting inventory plus purchases or production gives the goods available for sale. Ending inventory is the part still on hand, so removing it leaves the cost assigned to the items sold.

That figure is not the revenue collected from customers, and it is not a bucket for every bill the business pays. On a profit and loss statement, COGS is deducted from revenue first. The result is gross profit, before operating costs are taken out.

In accounting terms, COGS is the carrying value of goods sold during a particular period. Costs can be assigned using specific identification, first-in, first-out (FIFO), or average cost. The amount includes the costs of purchase and conversion, along with other costs of bringing inventory to its present location and condition. For goods made by the business, material, labor, and allocated overhead can form the cost, as the accounting definition sets out. Goods that have not been sold remain deferred as inventory on the balance sheet until they are sold or written down in value.

The inventory idea behind COGS

Starting inventory means the stock on hand at the beginning of the period. Purchases during period is the calculator's label for additional inventory bought or produced during that period. Ending inventory is the stock still unsold at the end.

Inventory flow: starting inventory plus purchases become goods available for sale, less ending inventory, equals COGS

Use the same period and inventory basis for all three figures. If ending stock is higher, more goods remain unsold and the calculated COGS is lower. If ending stock is lower, less is removed and more cost is assigned to sales. This describes the inventory flow without choosing a particular costing method.

An item bought for resale is recorded as an asset first, not an expense. Once it is sold, the inventory asset falls and the COGS account rises. The value then moves from the balance sheet to the expense line on the income statement. Unsold items remain in Inventory, while sold items appear in COGS. That is why the stock count and its valuation affect the reported expense, as this accounting explanation shows.

How do you calculate COGS from inventory?

The inventory formula is:

COGS = Starting inventory + Purchases - Ending inventory

Starting inventory plus purchases is the goods-available subtotal. Subtract ending inventory to remove the unsold portion. The Cost of Goods Sold Calculator uses that order and shows the subtotal before COGS, which makes each line easy to check.

The calculator has fields for Starting inventory, Purchases during period, Ending inventory, and Currency symbol. Its actions are Calculate COGS, Copy result, Download result (.txt), and Reset. Each amount must be finite and 0 or more. Ending inventory cannot be greater than starting inventory plus purchases. If it is, the calculator shows an error and hides the result.

It calculates from the values entered in the browser. There are no live rates or external data, and it does not choose a costing method or separately model write-downs, returns, shrinkage, or other adjustments. The related phrase cost of products sold concept refers to the same sold-inventory calculation here.

A worked inventory example

These figures are just an example. The arithmetic stays in the same order as the calculator:

Worked inventory example: $20,000 + $50,000 = $70,000, less $15,000 ending inventory, equals $55,000 COGS
Starting inventory:       $20,000
Purchases during period:  $50,000
Goods available for sale: $20,000 + $50,000 = $70,000
Ending inventory:         $15,000
COGS:                     $70,000 - $15,000 = $55,000

COGS comes to $55,000. The $15,000 ending balance is not part of that sold-goods cost because it is the inventory still left unsold in this example.

Keep the period and stock basis consistent

Measure opening and closing stock at the beginning and end of the same month, quarter, or fiscal period. Include purchases recorded within that period, using the same business scope and inventory basis.

A monthly opening balance paired with a quarterly closing balance can still produce a number, but it will not match the related revenue. The same problem occurs when the figures cover different stock scopes.

How inventory costing methods assign COGS

Counting the units is only part of the calculation. The business also needs a consistent way to assign purchase costs to the units sold. FIFO uses the oldest inventory currently in stock for the COGS calculation. LIFO uses the newest inventory currently in stock. With average cost, the cost of goods purchased is divided by the total number of items in stock to produce an average cost per item. Because each method expenses different inventory layers, two businesses with the same purchases can report different COGS and profit. When reviewing the calculator result, record the method used alongside the period figures, as this costing-method guide explains.

Which costs belong in COGS versus overhead?

COGS covers direct production costs tied to the items sold. Materials, direct labor, and other costs directly tied to what was sold fit that definition. Rent, administration, marketing, and other overhead not tied to a specific unit sold are operating expenses in a gross-profit calculation.

Production-related overhead does not automatically sit outside COGS. Depending on the relevant accounting policies, fixed factory overhead, storage costs, and sometimes depreciation expense can belong with the costs of producing goods, alongside variable raw-material and labor costs. Before adding a cost to the direct-cost total, check whether it helps produce the goods or provide the service. this COGS treatment overview makes that distinction.

Direct COGS inputs - materials and direct labor - versus overhead such as rent, administration, and marketing

Cost of products sold describes the same sold-inventory idea. Cost of sales is a common label for the direct-cost line. The accounting context determines which label appears, but the calculation does not change here. Do not put all business spending into COGS, and do not use COGS as a substitute for operating expenses or tax.

A service company can use the same direct-cost idea even without a traditional stock account. Costs directly associated with delivering the service are usually called cost of sales (COS). Use that label when the business reports service delivery costs, but keep those costs separate from broader operating expenses, as this cost-of-sales explanation describes.

Direct production costs

Consider a business that sells products. The materials and direct labor used for the units sold belong with those goods. That matches the Cost of goods sold (COGS) and Direct / material costs labels used by the Business Profit Calculator.

Use the direct-cost field for costs tied to what was sold. A business's other bills do not belong there automatically.

A production-focused calculation adds raw-material costs, labor costs, and all other direct costs of making the products sold in the period. This sum works alongside the inventory formula. Use the inventory view when you are reconciling opening stock, purchases, and closing stock. Use the direct-cost view when materials and labor are tracked to the products or jobs sold. The formula is stated by this direct-cost definition.

  • Direct inputs can include materials, direct labor, manufacturing overhead, storage, and freight or shipping costs, as this component list shows.
  • Indirect sales and administrative salaries, along with legal fees, travel costs, office supplies, and loan interest, stay outside this direct-cost list.

Packaging and direct labor can be tied to the product or sale. Item-specific sales commissions may also be included in COGS, depending on the business. A per-item commission is different from a general sales or administration bill, so document the policy used for product costs, as this cost classification example illustrates.

Indirect costs and overhead

Rent, administration, marketing, and other costs not tied to a specific unit sold are examples of overhead shown by the Business Profit Calculator. They affect operating or net profit, but they should stay separate from the COGS figure used to calculate gross profit.

Shipping is a policy edge case, so write down how it will be treated and use that treatment consistently. One QuickBooks glossary includes shipping or freight among costs directly related to producing goods, while another QuickBooks COGS article lists shipping among indirect costs. Decide whether the charge helps bring inventory to its present location and condition or is a selling and distribution cost. Then apply the policy to comparable periods; the two treatments are recorded in the QuickBooks glossary.

How does COGS affect gross profit on the P&L?

The income-statement sequence is:

P&L sequence: revenue minus COGS equals gross profit; overhead comes later; gross margin divides gross profit by revenue
Revenue - COGS = Gross profit
Gross margin % = Gross profit / Revenue x 100

On the profit and loss statement, COGS is the deduction between revenue and gross profit. Overhead and other operating expenses come later. Gross profit is not net profit.

These are chosen examples, not a benchmark. Keeping revenue at $12,000 shows what changes when only COGS changes:

Bar chart: Scenario A $4,800 COGS, $7,200 gross profit, 60%; Scenario B $7,800, $4,200, 35%
Scenario A
Revenue:      $12,000
COGS:          $4,800
Gross profit:  $12,000 - $4,800 = $7,200
Gross margin:  $7,200 / $12,000 x 100 = 60.00%

Scenario B
Revenue:      $12,000
COGS:          $7,800
Gross profit:  $12,000 - $7,800 = $4,200
Gross margin:  $4,200 / $12,000 x 100 = 35.00%

For the revenue and direct-cost step, the Gross Margin Calculator shows gross profit and gross margin. The Business Profit Calculator covers a wider scenario that also includes overhead and other profitability modes.

Calculating COGS shows the true cost of the merchandise sold in the period. The gross-profit line can then show whether prices cover the full direct cost of what was sold. COGS is more than a mechanical subtraction; the true-cost purpose is the useful test when reviewing a product or period.

Gross profit is not net profit

With revenue fixed, Scenario B leaves $3,000 less gross profit than Scenario A. That comparison does not include rent, administration, marketing, interest, or tax. Those are later deductions or separate items.

Gross profit only shows what remains after the direct cost of sold goods. It does not include overhead or tax, so those items need to stay separate when the result is carried into a wider profit calculation.

COGS can also show how efficiently the business manages raw materials and labor. Compare COGS with sales over time to see whether the business is becoming more efficient with those inputs. When the relationship changes, review the inputs instead of looking only at the final profit line, as this efficiency explanation notes.

How can a small business use COGS correctly?

Start with one reporting period and one stock basis. The calculator uses three entered values, shows goods available and its assumptions, and lets you copy or download the result. It does not fetch inventory records, market prices, or live data, and it is not accounting advice.

Generally, businesses that make goods may deduct COGS from gross receipts when business income is calculated for tax purposes. Classification and inventory valuation therefore affect more than internal reporting. An error in the COGS amount can change the business-income calculation, so reconcile the figure to the period records before using it in tax work, as this tax definition states.

A simple COGS review routine

  1. Choose the reporting period and scope. Use that same basis for opening stock, closing stock, purchases, and matching revenue.
  2. Confirm opening stock at the beginning of the period. Enter a finite, non-negative amount.
  3. Add purchases or production recorded during the same period, using the same inventory basis.
  4. Count or value closing stock at the end of the period. It must be non-negative and no greater than goods available, which is starting inventory plus purchases.
  5. Calculate COGS and compare it with matching revenue to review gross profit. The currency symbol changes the display only; it does not convert currencies. Keep overhead outside the COGS figure.
Five-step COGS checklist: choose period, confirm opening stock, add purchases, count closing stock, calculate, compare

Before carrying COGS to a P&L, check that the inputs and the result period still match.

Compare the resulting COGS with inventory and revenue. This shows how fast inventory is selling and helps determine the gross-profit margin. Ask whether the stock balance and the COGS balance tell the same period story. If inventory speed or margin changes, use the result to investigate instead of filing the number away after the calculation, as this inventory analysis guidance recommends.

Frequently asked questions

What is the simplest cost of goods sold formula?

COGS = Starting inventory + Purchases - Ending inventory. Starting inventory plus purchases is goods available for sale, and ending inventory is the unsold portion removed from that subtotal.

Is COGS an expense on the profit and loss statement?

COGS is shown as a deduction from revenue to calculate gross profit on the P&L. Later operating expenses are separate deductions used to move from gross profit toward operating or net profit.

Are rent and marketing included in cost of goods sold?

When rent, administration, and marketing are not tied to a specific unit sold, they are overhead rather than direct COGS inputs. They belong in the operating-expense view instead of being added automatically to COGS.

What is the difference between cost of products sold and cost of sales?

Both labels can refer to the direct cost assigned to what was sold, including the inventory-based COGS concept. The accounting context determines the label; the formula and period matching remain the focus here.

How does COGS change gross profit?

Revenue - COGS = Gross profit. With revenue held constant, higher COGS leaves less gross profit; gross margin divides gross profit by revenue and does not include overhead or tax.