{"id":139,"date":"2015-05-29T09:38:05","date_gmt":"2015-05-29T07:38:05","guid":{"rendered":"http:\/\/wpcalc.com\/?p=139"},"modified":"2026-09-30T19:29:33","modified_gmt":"2026-09-30T16:29:33","slug":"cost-of-goods-sold","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/finance\/cost-of-goods-sold\/","title":{"rendered":"Cost of Goods Sold Calculator"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">COGS (Cost of Goods Sold) Calculator<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"139\" data-favorite-title=\"Cost of Goods Sold\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/finance\/cost-of-goods-sold\/\" data-favorite-excerpt=\"Calculate Cost of Goods Sold (COGS) from your beginning inventory, purchases, and ending inventory. Enter the three values to find COGS for gross profit, pricing, and tax reporting.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-inventory\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/finance\/cost-of-goods-sold\/\" method=\"POST\" class=\"calculator\" id=\"calculator-139\" data-post=\"139\"><fieldset class=\"fieldset-input\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field has-term\" id=\"input-1\"><label for=\"field-1\">Beginning inventory<\/label><div class=\"term\">BI<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"beginning_inventory\" id=\"field-1\" aria-describedby=\"calc-unit-1 calc-info-1\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"30000\"\/><div class=\"unit\" id=\"calc-unit-1\">$<\/div><small id=\"calc-info-1\">Value of inventory at the start of the period<\/small><\/div><div class=\"field has-term\" id=\"input-2\"><label for=\"field-2\">Purchases<\/label><div class=\"term\">P<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"purchases\" id=\"field-2\" aria-describedby=\"calc-unit-2 calc-info-2\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"50000\"\/><div class=\"unit\" id=\"calc-unit-2\">$<\/div><small id=\"calc-info-2\">Inventory purchased during the period<\/small><\/div><div class=\"field has-term\" id=\"input-3\"><label for=\"field-3\">Ending inventory<\/label><div class=\"term\">EI<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"ending_inventory\" id=\"field-3\" aria-describedby=\"calc-unit-3 calc-info-3\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"25000\"\/><div class=\"unit\" id=\"calc-unit-3\">$<\/div><small id=\"calc-info-3\">Value of inventory remaining at the end of the period<\/small><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"139\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Your Results<\/h3><div class=\"result-box\"><div class=\"field-result\" id=\"output-1\"><span class=\"field-title\"><span>Cost of Goods Sold<\/span><\/span><span class=\"field-value\" id=\"result-1\" data-unit=\"$\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"139\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Cost of Goods Sold Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ \\text{COGS} = \\text{Beginning Inventory} + \\text{Purchases} - \\text{Ending Inventory} \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(\\text{BI}\\) \u2014 beginning inventory: the value of goods in stock at the start of the period ($)<\/li>\n<li>\\(\\text{P}\\) \u2014 purchases: the cost of inventory bought or produced during the period ($)<\/li>\n<li>\\(\\text{EI}\\) \u2014 ending inventory: the value of goods still in stock at the end of the period ($)<\/li>\n<\/ul>\n<p>The formula captures a simple idea: whatever you started with, plus whatever you added, minus what is left over, must be what you sold. The result is the direct cost of the goods that left your shelves during the period.<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Cost of Goods Sold \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> a retailer begins the quarter with $30,000 of inventory, buys $50,000 of additional stock during the quarter, and counts $25,000 of inventory remaining at the end.<\/p>\n<p>\\[ \\text{COGS} = 30{,}000 + 50{,}000 - 25{,}000 \\]<\/p>\n<p>\\[ \\text{COGS} = 55{,}000 \\]<\/p>\n<p><strong>Result:<\/strong> the cost of goods sold for the quarter is <strong>$55,000<\/strong>. If quarterly revenue was, say, $82,000, the gross profit would be $82,000 \u2212 $55,000 = $27,000.<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Calculator<\/h2>\n<ol>\n<li>Enter the <strong>Beginning inventory<\/strong> \u2014 the value of goods on hand at the start of the accounting period, taken from your opening balance or prior period's ending inventory.<\/li>\n<li>Enter the <strong>Purchases<\/strong> \u2014 the total cost of inventory purchased (or, for manufacturers, produced) during the period, at cost rather than retail price.<\/li>\n<li>Enter the <strong>Ending inventory<\/strong> \u2014 the value of goods remaining in stock at the end of the period, usually from a physical count or perpetual inventory system.<\/li>\n<li>Read the <strong>Cost of Goods Sold<\/strong> result, expressed in dollars, below the inputs.<\/li>\n<\/ol>\n<h2>What Is Cost of Goods Sold?<\/h2>\n<p>Cost of Goods Sold (COGS) is the direct cost of the goods a business sells during an accounting period. For a retailer, it is the amount paid to suppliers for the merchandise sold. For a manufacturer, it includes raw materials, direct labor, and factory overhead tied to the finished goods sold. COGS appears on the income statement immediately below revenue and is subtracted from it to arrive at <a href=\"https:\/\/wpcalc.com\/en\/finance\/sales-gross-profit-margin\/\">gross profit<\/a>.<\/p>\n<p>What COGS deliberately excludes is just as important as what it includes. Operating expenses such as rent, marketing, distribution, administrative salaries, and interest are not part of COGS \u2014 they are reported further down the income statement. Keeping these categories separate is what makes the gross profit margin meaningful as a measure of production or buying efficiency.<\/p>\n<p>COGS matters for several practical reasons. It determines gross profit, which drives pricing and margin decisions. It affects taxable income, since a higher COGS means a lower reported profit and lower income tax. It also serves as a check on inventory management: if the calculated COGS does not match what your sales data suggests, it may indicate shrinkage, theft, miscounted stock, or accounting errors. Tools like the <a href=\"https:\/\/wpcalc.com\/en\/finance\/days-in-inventory\/\">days in inventory<\/a> and <a href=\"https:\/\/wpcalc.com\/en\/finance\/inventory-stock\/\">inventory stock<\/a> calculators can extend this analysis.<\/p>\n<h2>Inventory Valuation Methods<\/h2>\n<p>The simple COGS formula works identically under any inventory costing method, but the numbers you plug into it depend on which method your business uses:<\/p>\n<ul>\n<li><strong>FIFO (First In, First Out):<\/strong> the oldest goods are sold first. In periods of rising prices this produces a lower COGS and higher profit. See the <a href=\"https:\/\/wpcalc.com\/en\/finance\/fifo-inventory-cost\/\">FIFO inventory cost calculator<\/a>.<\/li>\n<li><strong>LIFO (Last In, First Out):<\/strong> the newest goods are sold first, producing a higher COGS when prices rise. Not permitted under IFRS, but allowed in the US under GAAP.<\/li>\n<li><strong>Weighted Average Cost:<\/strong> each unit is valued at the average cost of all units in stock, smoothing out price fluctuations.<\/li>\n<\/ul>\n<h2>Assumptions and Limitations<\/h2>\n<ul>\n<li>The calculator assumes all inventory changes come from purchases and sales. It does not separately track write-offs, shrinkage, returns to suppliers, or goods damaged in storage \u2014 these should be reflected in your ending inventory count or adjusted before entering it.<\/li>\n<li>Enter all three values at cost, not retail price. Mixing a cost-based beginning inventory with a retail-value purchase total will distort the result.<\/li>\n<li>The formula gives period totals, not unit-level detail. For product-by-product margins you need a per-SKU breakdown from your accounting or inventory system.<\/li>\n<li>COGS is not the same as total expenses. Do not add shipping to customers, sales commissions, or marketing costs \u2014 these belong in operating expenses.<\/li>\n<li>Consistency matters for tax purposes: once you choose an inventory valuation method, keep using it across periods unless you formally change it.<\/li>\n<\/ul>\n<h2>Practical Tips<\/h2>\n<ul>\n<li>Take a physical inventory count at the end of each period; an accurate ending inventory value is the single biggest source of COGS accuracy.<\/li>\n<li>Remember that ending inventory of one period is the beginning inventory of the next \u2014 carry it forward unchanged.<\/li>\n<li>Compare COGS to revenue as a percentage over time. A rising COGS ratio with flat prices suggests supplier costs are eating into your margins, which may call for repricing or renegotiation.<\/li>\n<li>If you plan production or purchasing volumes, pair COGS with the <a href=\"https:\/\/wpcalc.com\/en\/finance\/economic-order-quantity\/\">economic order quantity<\/a> and <a href=\"https:\/\/wpcalc.com\/en\/finance\/ending-inventory\/\">ending inventory<\/a> calculators to plan stock levels.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Calculate Cost of Goods Sold (COGS) from your beginning inventory, purchases, and ending inventory. Enter the three values to find COGS for gross profit, pricing, and tax reporting.<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[26],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-finance","tag-inventory"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":3,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":66066,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/139\/revisions\/66066"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}