Skip to content
Business

Cost of Goods Sold Calculator

Calculate Cost of Goods Sold (COGS), gross profit, gross profit margin, and inventory turnover.

Inventory & Production Inputs

$
$
$
$
$

Enter period revenue to calculate gross profit, profit margin, and markup on cost.

Cost of Goods Sold (COGS)

$194,000.00

Beginning Inventory ($45,000.00) + Additions ($187,000.00) - Ending Inventory ($38,000.00)

Gross Profit

$146,000.00

Revenue ($340,000.00) - COGS ($194,000.00)

Gross Profit Margin

42.94%

42.9% of revenue retained after production/purchases

Goods Available for Sale

$232,000.00

Total stock available during the accounting period

Average Inventory

$41,500.00

(Beginning $45,000.00 + Ending $38,000.00) ÷ 2

Inventory Turnover Ratio

4.67x

COGS ÷ Average Inventory

Days Sales in Inventory (DSI)

78 days

Average days to liquidate on-hand stock

Markup on Cost

75.26%

Gross profit as a percentage of COGS

COGS to Revenue Ratio

57.06%

Percentage of revenue spent directly on goods

Goods Available for Sale Breakdown

Available Stock$232,000.00
  • Cost of Goods Sold (COGS)$194,000.0083.6%
  • Ending Inventory (Unsold)$38,000.0016.4%

COGS & Profitability Step-by-Step Breakdown

Mathematical accounting derivation of Cost of Goods Sold and inventory efficiency metrics.

  1. Calculate Total Goods Available for Sale

    Goods Available for Sale=Beginning Inventory+Purchases+Freight-In=$45,000+$175,000+$12,000=$232,000\text{Goods Available for Sale} = \text{Beginning Inventory} + \text{Purchases} + \text{Freight-In} = \$45,000 + \$175,000 + \$12,000 = \$232,000

    Add beginning inventory ($45,000) to new inventory purchases ($175,000) and direct inbound shipping costs ($12,000).

  2. Deduct Ending Inventory to Determine COGS

    COGS=Goods Available for SaleEnding Inventory=$232,000$38,000=$194,000\text{COGS} = \text{Goods Available for Sale} - \text{Ending Inventory} = \$232,000 - \$38,000 = \$194,000

    Subtract ending physical inventory ($38,000) from total goods available for sale to find the direct cost of units sold.

  3. Calculate Gross Profit & Gross Margin

    Gross Profit=RevenueCOGS=$340,000$194,000=$146,000,Margin=$146,000$340,000×100%=42.94%\text{Gross Profit} = \text{Revenue} - \text{COGS} = \$340,000 - \$194,000 = \$146,000, \quad \text{Margin} = \frac{\$146,000}{\$340,000} \times 100\% = 42.94\%

    Gross profit reflects top-line revenue ($340,000) minus the direct cost of producing/buying those sold goods ($194,000).

  4. Calculate Inventory Turnover & Days Sales in Inventory (DSI)

    Turnover Ratio=COGSAverage Inventory=$194,000$41,500=4.67×,DSI=3654.67=78.1 days\text{Turnover Ratio} = \frac{\text{COGS}}{\text{Average Inventory}} = \frac{\$194,000}{\$41,500} = 4.67\times, \quad \text{DSI} = \frac{365}{4.67} = 78.1\text{ days}

    Average inventory is $41,500. Turnover measures how many times inventory is sold and replaced over the period.

Report tool

What is Cost of Goods Sold (COGS)?

Cost of Goods Sold (COGS), also known as cost of sales, measures the direct costs incurred in producing or acquiring the merchandise sold by a business during a specific accounting period. It includes the purchase price of raw materials, inbound shipping and freight fees, and direct factory labor, while excluding indirect operating costs such as marketing, office rent, and executive salaries.

COGS sits directly below gross revenue on the income statement. Subtracting COGS from total sales yields gross profit, the primary metric of product-level profitability. When evaluating how unit sales cover both direct product costs and indirect operational overhead, you can evaluate your company sales target with the break-even calculator, analyze unit economics with the contribution margin calculator, calculate e-commerce marketplace deductions using our Etsy fee calculator, or verify bottom-line operating earnings using the accounting profit calculator.

The COGS Formula and Calculation Methods

Under the periodic inventory accounting system, COGS is calculated by measuring the net flow of physical inventory across the accounting cycle:

COGS=Beginning Inventory+Purchases / Direct AdditionsEnding Inventory\text{COGS} = \text{Beginning Inventory} + \text{Purchases / Direct Additions} - \text{Ending Inventory}

The accounting steps break down as follows:

  • Beginning Inventory: The monetary value of unsold merchandise or raw materials held in stock at the very start of the accounting period (equal to the previous period ending inventory).
  • Purchases & Inbound Freight: The invoice cost of all newly acquired products plus direct transportation and customs costs required to place inventory in a sellable location.
  • Total Goods Available for Sale: The total inventory accessible for customer fulfillment throughout the period, defined as Beginning Inventory+Additions\text{Beginning Inventory} + \text{Additions}.
  • Ending Inventory: The physical count and valuation of unsold items on hand at the close of the period, recorded on the balance sheet as a current asset and calculated using the ending inventory calculator.

Retail vs. Manufacturing COGS Breakdown

The composition of COGS varies depending on whether a company resells finished goods or manufactures custom products from raw materials:

1. Retail and Merchandising Businesses

Retailers, wholesalers, and e-commerce stores buy finished goods ready for resale. For retailers, COGS consists of wholesale purchase prices plus direct inbound shipping (freight-in). Outbound delivery to customers is classified as a selling expense, not COGS.

2. Manufacturing Businesses (Cost of Goods Manufactured)

Manufacturers convert raw materials into finished merchandise through physical labor and factory tooling. Direct manufacturing costs include:

  • Direct Materials: Raw commodities and sub-components physically incorporated into the finished product. When operating under standard costing, track raw material procurement differences with the direct material price variance calculator.
  • Direct Labor: Wages and payroll taxes paid to assembly line operators, machinists, and fabricators.
  • Manufacturing Overhead: Factory-level expenses directly tied to production, such as assembly plant utilities, machinery depreciation, and production facility supplies.
COGSMfg=Beginning Inventory+(Raw Materials+Direct Labor+Overhead)Ending Inventory\text{COGS}_{\text{Mfg}} = \text{Beginning Inventory} + (\text{Raw Materials} + \text{Direct Labor} + \text{Overhead}) - \text{Ending Inventory}

Step-by-Step Worked COGS Example

Consider an e-commerce home goods merchant reviewing quarterly performance. The merchant records the following financial data:

  • Beginning Inventory: $45,000
  • Merchandise Purchases: $175,000
  • Direct Inbound Freight: $12,000
  • Ending Physical Inventory: $38,000
  • Gross Quarterly Revenue: $340,000

Step 1: Calculate Goods Available for Sale

Goods Available=$45,000+$175,000+$12,000=$232,000\text{Goods Available} = \$45{,}000 + \$175{,}000 + \$12{,}000 = \$232{,}000

Step 2: Calculate Cost of Goods Sold (COGS)

COGS=$232,000$38,000=$194,000\text{COGS} = \$232{,}000 - \$38{,}000 = \$194{,}000

Step 3: Calculate Gross Profit and Gross Margin

Gross Profit=$340,000$194,000=$146,000\text{Gross Profit} = \$340{,}000 - \$194{,}000 = \$146{,}000
Gross Margin=($146,000$340,000)×100%=42.94%\text{Gross Margin} = \left( \frac{\$146{,}000}{\$340{,}000} \right) \times 100\% = 42.94\%

Step 4: Analyze Inventory Turnover and Holding Efficiency

Average Inventory=$45,000+$38,0002=$41,500\text{Average Inventory} = \frac{\$45{,}000 + \$38{,}000}{2} = \$41{,}500
Inventory Turnover=$194,000$41,500=4.67×,DSI=3654.67=78.1 days\text{Inventory Turnover} = \frac{\$194{,}000}{\$41{,}500} = 4.67\times, \quad \text{DSI} = \frac{365}{4.67} = 78.1\text{ days}

The business converts its complete inventory roughly 4.67 times per year, requiring an average of 78 days to sell incoming stock. You can evaluate the broader cash conversion pipeline across receivables, payables, and inventory using our cash conversion cycle calculator.

Key Differences: COGS vs. Operating Expenses (OPEX)

Cost CategoryIncluded in COGSOperating Expense (OPEX)
Direct Raw MaterialsYes (Direct cost of production)No
Direct Assembly LaborYes (Factory floor workforce)No
Inbound Freight & CustomsYes (Cost to receive inventory)No
Marketing & AdvertisingNoYes (Selling expense)
Administrative Salaries & RentNoYes (General and administrative)

Frequently asked questions

What is the difference between COGS and operating expenses (OPEX)?
COGS includes only direct costs incurred to manufacture or purchase the products sold to customers. Operating expenses (OPEX) are indirect operational costs required to run the overall business, including corporate salaries, office rent, legal fees, software subscriptions, and marketing campaigns.
Why is ending inventory subtracted in the COGS formula?
Ending inventory consists of products purchased or manufactured during the period that remain unsold in the warehouse. Because revenue from these unsold units has not yet been recognized, accounting matching rules require these costs to be retained on the balance sheet as assets rather than expensed as COGS.
How do inventory valuation methods (FIFO vs. LIFO) impact COGS?
Under First-In, First-Out (FIFO), the oldest inventory costs are assigned to COGS first. In times of rising inflation, FIFO results in lower COGS and higher reported net income. Under Last-In, First-Out (LIFO), the newest, more expensive inventory costs are expensed first, resulting in higher COGS and lower taxable income.
Do service-based businesses report Cost of Goods Sold?
Service companies with no physical inventory typically do not report COGS. Instead, they report Cost of Services (COS) or Cost of Revenue, which reflects direct billable contractor hours, client software licenses, and direct project fulfillment costs.
How does COGS affect business income taxes?
COGS is a direct 100% tax deduction against gross revenue on corporate and business tax filings (such as IRS Form 1125-A). Accurately accounting for all eligible direct costs lowers taxable gross profit and reduces overall business income tax liability.
What is a healthy Gross Profit Margin and COGS ratio?
Healthy gross margins depend heavily on industry dynamics. Software (SaaS) companies often maintain gross margins of 75% to 85% (15% to 25% COGS ratio), whereas retail grocers and consumer electronics distributors operate on tight gross margins of 15% to 30% (70% to 85% COGS ratio).

Resources and references

The formulas and methods in this calculator were checked against these independent sources.