About Cogsly
Your COGS, gross profit, and margin — in one calculation.
Cogsly is a free, client-side calculator for Cost of Goods Sold (COGS), gross profit, and gross margin. Enter your inventory figures, hit calculate, and get instant results. No sign-up and no server calls.
What Is COGS?
Cost of Goods Sold represents the direct costs attributable to the production or purchase of goods that a business sells during a specific period. It appears on the income statement and is subtracted from revenue to determine gross profit.
The standard formula is:
Where:
- Beginning Inventory — the value of inventory on hand at the start of the accounting period.
- Purchases — the cost of additional inventory bought or manufactured during the period.
- Direct Expenses — costs directly tied to getting goods ready for sale (freight-in, import duties, factory labour allocated to specific products).
- Ending Inventory — the value of unsold inventory remaining at the end of the period.
Once you know COGS, you can derive two profitability metrics:
Direct Expenses vs. Overhead
Not every cost belongs in COGS. Only direct costs — expenses that can be traced to specific products — should be included.
Direct Expenses (include in COGS)
- Raw materials and components
- Freight-in / inbound shipping
- Import duties and tariffs
- Factory labour directly tied to production
- Packaging materials
- Subcontracted manufacturing
Overhead (do NOT include)
- Office rent and utilities
- Administrative salaries
- Marketing and advertising
- Outbound shipping to customers
- Depreciation on office equipment
- Insurance (unless product-specific)
Inventory Valuation: FIFO vs. LIFO
The value you assign to beginning and ending inventory depends on which cost-flow assumption your business uses. The two most common methods are:
FIFO
First-In, First-Out
Assumes the oldest inventory is sold first. In periods of rising prices, FIFO results in lower COGS and higher gross profit because the cheaper, earlier-purchased items are expensed first.
LIFO
Last-In, First-Out
Assumes the newest inventory is sold first. In rising-price environments, LIFO results in higher COGS and lower gross profit, which can reduce taxable income. LIFO is permitted under US GAAP but not under IFRS.
A third method, Weighted Average Cost, divides total inventory cost by total units to get a per-unit average. Cogsly works with any method — simply enter the inventory values your accounting system provides.
Who It's For
Cogsly is built for anyone who needs to calculate COGS without signing up for accounting software. That includes:
- Ecommerce sellers running a Shopify or Etsy store who want a quick margin check before setting prices.
- Small business owners tracking inventory costs by hand or in a spreadsheet.
- Accounting students working through COGS problems and wanting to verify their math.
- Freelance bookkeepers who need a fast sanity check on client figures.
Why "Cogsly"?
COGS + friendly suffix. The name is a nod to the acronym at the center of the tool. Nothing fancy, just easy to remember.
Your Data Stays in Your Browser
Cogsly runs entirely in your browser. Every calculation happens client-side using JavaScript. No inventory figures, revenue numbers, or financial data are ever transmitted to a server, stored in a database, or shared with third parties.
There are no user accounts, no cookies for tracking financial inputs, and no server-side processing. When you close or refresh the page, your numbers are gone.
For full details, see our Privacy Policy.
Questions or Feedback?
Found a bug, have a feature request, or just want to say hello? Reach out through our contact form and we will get back to you.