Skip to main content
Back to blog
Accounting

Stock variation calculation: how to calculate stock variation for your e-commerce business

21 min read By The Bizyness team

Master stock variation calculation with our clear guide: WAC and FIFO explained to optimize management and margins.

Stock variation calculation: how to calculate stock variation for your e-commerce business

Stock variation boils down, on the surface, to a very simple formula: Closing Stock - Opening Stock. But behind this simplicity lies an indicator that can radically change the perceived health of your business. This gap determines whether your stock has grown (which counts as income) or shrunk (an expense), with a direct impact on your net result and, of course, your taxes.

Why this calculation is far more than a line on your balance sheet

For an online seller, the stock variation calculation is far from just a box to tick for the accountant at year-end. It’s a genuine barometer of your financial and operational performance. Believe me, an approximate valuation can trigger a disastrous domino effect, distorting your balance sheet and hiding much deeper problems.

A man manages parcels and a laptop, surrounded by cardboard boxes, against a background of green and red splashes.

Take a concrete case. Imagine you overestimate the value of your year-end stock. On paper, your profit looks higher than it really is. The consequence? You pay more tax on gains that don’t really exist. Conversely, an undervaluation is just as dangerous: it can mask losses, theft, or chaotic management of unsold items, leaving you with a false sense of security while your cash flow is actually at risk.

A genuine strategic tool for steering your e-commerce business

Whether you sell on Shopify, Amazon, or your own WooCommerce store, mastering this calculation is a fundamental growth lever. An accurate understanding of your stock gives you the power to:

  • Optimize your cash flow by avoiding letting money sit idle in products gathering dust.
  • Calculate your real margins, not estimates, by knowing the exact cost of goods sold.
  • Make smart purchasing decisions, based on concrete data about how your products turn over.

Think of an online seller running their own clothing brand (D2C). At year-end closing, they notice a strong positive variation in their stock. From an accounting standpoint, this means their merchandise purchases exceeded their sales, which reduces expenses and increases taxable profit. But from a strategic standpoint, it’s a warning sign. They probably bought too much. It’s time to review their sourcing strategy or launch promotions to clear old collections before they lose all their value.

An accurate stock variation calculation is not just a tax obligation; it’s the direct reflection of your ability to turn an investment in merchandise into tangible profit.

In this guide, we’ll break it all down step by step. We’ll cover the basic formula, the different methods for valuing your products (such as WAC or FIFO), the accounting entries to record, and above all, how a tool like Bizyness can automate and make this essential process more reliable for your profitability.

Stock variation: breaking down the formula and its calculation

The stock variation calculation may seem intimidating, but it rests on a surprisingly simple formula. Yet behind this apparent ease lies a mechanism that has a direct impact on the profitability of your e-commerce business.

Here’s the basic formula:

Stock variation = Closing Stock Value – Opening Stock Value

The operation itself is child’s play. The real challenge, and where many people stumble, is correctly valuing these two amounts. A small error on the opening or closing stock value, and your entire accounting result ends up distorted.

Defining opening stock and closing stock

To understand this properly, think of these two notions as reference points in time.

Opening stock is simply the starting point of your accounting year. It corresponds to the value of all your merchandise, raw materials, and products on the very first day of the fiscal year. Fortunately, there’s no need to recalculate it every year: it is nothing more or less than the value of the closing stock from the previous fiscal year. In accounting, continuity is king.

On the other side, we have the closing stock. This is a snapshot of the value of everything you own in stock on the last day of the fiscal year. To obtain it, you carry out the annual physical inventory, an often laborious but absolutely mandatory step. The most organized online sellers use a perpetual inventory system, where every inbound and outbound movement is tracked in real time, which greatly simplifies the task.

Let’s take a concrete example: a fashion boutique on Shopify. On January 1st, its opening stock is valued at €25,000. After a year of sales and restocking, the inventory on December 31st reveals that €18,000 worth of merchandise remains.

The calculation is then quick: €18,000 (Closing Stock) - €25,000 (Opening Stock) = -€7,000

This negative result indicates one thing: the value of the stock has decreased. In accounting terms, this drop of €7,000 is an expense that will reduce taxable profit. That makes sense: these products were sold, so they “cost” the business.

The direct impact of stock variation on your result

Understanding how this calculation affects your finances is fundamental. The link between your warehouse and your income statement is much more direct than one might imagine.

The table below summarizes how a positive or negative variation directly affects the operating expenses and taxable profit of your online store.

Type of VariationConcrete MeaningEffect on Operating ExpensesEffect on Taxable Profit
Negative VariationYou sold or consumed more stock than you purchased during the period (destocking).Increases expenses.Decreases taxable profit.
Positive VariationYou purchased more stock than you sold or consumed (stockpiling).Decreases expenses.Increases taxable profit.

This mechanism ensures that only merchandise actually sold or consumed during the year is recorded as an expense.

Now imagine an artisan selling handmade jewelry on Etsy. They start the year with a stock of beads and metals worth €3,000. Anticipating strong holiday demand, they ordered a lot at year-end. Their closing stock is therefore valued at €5,500.

Their stock variation is: €5,500 (Closing Stock) - €3,000 (Opening Stock) = +€2,500

This positive variation is treated as income. In accounting terms, it reduces the total amount of raw material purchases, which mechanically increases taxable profit.

Good stock management is therefore intrinsically linked to your profitability. To go further on the principles of inventory management and their role in a business’s success, this article is an excellent resource.

The importance of these flows is such that it’s even measured at the national scale. In the first quarter of 2025, changes in company inventories contributed +1.0 point to French GDP growth! That shows just how central this topic is, especially in an e-commerce sector that saw transactions increase by +6%.

This calculation is therefore not just a simple accounting exercise. It’s a genuine performance indicator showing whether you’re managing to effectively turn your purchases into sales. To get started, our guide on efficient stock management with Excel is an excellent starting point before moving to more automated solutions.

Choosing your stock valuation method: WAC or FIFO?

Now that the stock variation formula holds no more secrets for you, a crucial question arises: how do you concretely “value” this stock? If you buy the same t-shirt for €10, then €11, then €10.50, which price should you use to calculate the value of what’s left at year-end?

That’s where valuation methods come in. In France, the General Chart of Accounts (Plan Comptable Général) mainly authorizes two: the WAC (Weighted Average Cost) and FIFO (First In, First Out). Your choice is not trivial, as it directly influences your stock variation, and therefore your taxable result.

The WAC method, the simple choice for e-commerce

WAC is by far the most widely used method. And for good reason: it’s simple, logical, and smooths out sometimes erratic fluctuations in purchase prices.

The principle? With every new receipt of merchandise, a new average unit cost is recalculated for the item in question. This new average cost is then used to value all sales (stock outflows) until the next restock. It’s a pragmatic approach, especially for online sellers juggling hundreds of non-perishable SKUs. No need to track each item individually anymore.

Let’s take the concrete example of a t-shirt seller on Shopify:

  • Opening stock: 50 t-shirts bought at €10 each.
  • Purchase #1: 100 additional t-shirts, this time at €12 each.
  • Purchase #2: 75 t-shirts at €11 each.

After the first purchase, the WAC is updated. The total stock value becomes (50 x €10) + (100 x €12) = €1,700, for a total of 150 units in stock. The new average unit cost is therefore €1,700 / 150 = €11.33. All subsequent sales will be valued based on this cost, until the next delivery.

The FIFO method, essential for fast-turnover products

FIFO relies on a very different logic: the first products in stock are the first to leave. Picture a queue: first come, first served. That’s exactly it.

This method isn’t just an accounting choice, it becomes an operational necessity for certain types of products:

  • Perishable goods: to make sure items are sold before their expiration date.
  • Fashion items: to clear last season’s collection before the new one arrives.
  • Tech products: to avoid getting stuck with obsolete models.

FIFO much more closely reflects the reality of the physical flow of goods. Be careful, however: during periods of inflation (when purchase prices rise), this method tends to show a higher profit. Why? Because the cost of goods sold is based on older, lower purchase prices. Higher profit also means more tax.

A key principle: consistency of methods. What matters most is consistency. Once you’ve chosen a valuation method (WAC or FIFO), you must keep it from one fiscal year to the next. A change is possible, but it must remain exceptional and be solidly justified in the notes to your balance sheet.

This diagram illustrates well how stock variation, whether positive or negative, will impact your result.

Decision tree explaining the tax impact of a stock variation, whether negative or positive.

It’s clear to see: a negative variation (you destocked) is an expense that reduces your profit. Conversely, a positive variation (you have more stock) is income that increases it.

So, WAC or FIFO: how do you decide?

This choice deserves real thought. To help you, here is a short comparison table summarizing the essential points, whether you sell on Amazon, Etsy, or your own store.

FeatureWAC MethodFIFO Method
Calculation simplicityHigh. A single average cost to manage per product.Moderate. You need to track each purchase batch with its own cost.
Ideal for…Non-perishable products, stock with fairly stable purchase prices.Perishable products, fashion items, high-tech.
Impact during inflationSmooths costs, which moderates the result.Lower cost of goods sold, so higher profit and taxes.
Reflection of physical flowDoesn’t necessarily match the reality of product movement.Much more faithful to the actual flow of the oldest goods.
E-commerce recommendationPerfect for the vast majority of stores (clothing, home decor, accessories…).Essential for food, cosmetics, or fast fashion.

Ultimately, WAC is often the reasonable choice for its simplicity and accounting robustness. But if the nature of your products requires precise management of entry dates to avoid losses, FIFO is no longer an option, it’s a requirement. Take the time to analyze your products and flows before deciding.

The accounting translation of stock variation

Your stock variation calculation is done and the final value is on the table. Great. Now it needs to be translated into accounting language. This may seem a little intimidating at first, but the logic is actually quite simple and, once you get the hang of it, it becomes a year-end routine.

The idea is to ensure your company’s balance sheet reflects the real value of what you have in stock at the time of closing. To achieve this, you proceed in two steps, at the end of each fiscal year.

  • First, you cancel the opening stock value (the one from the beginning of the year).
  • Then, you record the new closing stock value (the one you just calculated).

This set of entries ensures that only merchandise actually sold or consumed affects your result. That’s the heart of the mechanism.

The entry to cancel the opening stock

The very first thing to do is to accounting-wise “empty out” the stock value that appeared on the previous year’s (N-1) balance sheet. Specific accounts from the General Chart of Accounts are used for this. This is what’s called a cancellation entry.

Let’s take a concrete example: an online seller specializing in home decor. At the start of fiscal year N, they had a merchandise stock valued at €15,000.

To close out this opening stock, the accounting entry is as follows:

  • Debit the account 6037 “Change in merchandise inventories” for €15,000. In plain terms, this increases the company’s expenses.
  • Credit the account 37 “Merchandise inventories” for €15,000. Here, this decreases the stock value on the balance sheet’s asset side.

And there you have it, the stock from year N-1 is accounting-wise reset to zero.

Recording the new closing stock

Now that the counters are back to zero, it’s time to record the new value, the one that came out of your year-end inventory for year N. This is simply the reverse entry of the previous one.

Let’s say our online seller, after going through their warehouse, arrives at a closing stock value of €12,500.

To reflect this new amount on the balance sheet, the entry is as follows:

  • Debit the account 37 “Merchandise inventories” for €12,500, which increases the stock value on the asset side.
  • Credit the account 6037 “Change in merchandise inventories” for €12,500, which this time reduces the overall amount of expenses.

With this second operation, your balance sheet is up to date, ready to start the new fiscal year with the correct stock value. If you need a refresher on the structure of accounts, our article on the chart of accounts is an excellent resource for better understanding how everything fits together.

In summary: the balance of account 6037 shows €15,000 (debit) - €12,500 (credit) = €2,500 on the debit side. This figure corresponds exactly to our stock variation of -€2,500, which is therefore an expense reducing taxable profit.

What tax impact lies behind these entries?

It should never be forgotten: every accounting entry has a tax consequence. A simple error in handling your stock variation can distort your taxable base and, in the worst-case scenario, trigger a tax audit.

If your stock variation is negative, as in our example (you destocked), the balance of your account 6037 is a debit balance. It behaves like an expense and therefore reduces your taxable profit. Result: you pay less corporate tax (IS) or income tax (IR).

Conversely, if your stock variation is positive (you stocked more than you sold), the balance of the variation account acts like income. It increases your taxable profit, and therefore the amount of tax due.

An overvaluation of your closing stock, even unintentional, can artificially inflate your result and cost you dearly in taxes. An undervaluation, if discovered, can lead to a severe tax reassessment. Rigor is therefore not optional; it’s the credibility of your financial management that’s at stake.

Handling complex situations in e-commerce

The reality on the ground in e-commerce is rarely as simple as stock sitting quietly on a shelf. Dozens of situations complicate the stock variation calculation at year-end. Handling these special cases rigorously is not optional, it’s a necessity to guarantee the accuracy of your balance sheet and tax return.

French e-commerce has, moreover, reached a record turnover of €196.4 billion, with more than 100 orders placed every second. This explosion in volume means exceptions are becoming the norm. Faced with such a pace, especially during peaks like Black Friday, which accounts for 22% of annual sales, manual handling of complex cases exposes businesses to critical errors. To learn more about this market dynamic, you can consult the details of the Fevad study.

Merchandise in transit at year-end closing

This is a classic scenario. You paid for a large order from your supplier in China on December 20th. On December 31st, the date of your inventory, the products are still on a container ship in the middle of the ocean. The question arises: should they appear in your closing stock?

It all depends on the transfer of ownership, a legal detail defined by the sale’s Incoterms.

  • If ownership is transferred to you upon shipment (which is often the case), then yes, this merchandise does indeed belong to you. You must include it in the value of your closing stock, even if it’s not physically in your warehouse.
  • If ownership is transferred upon delivery, then the merchandise still belongs to your supplier. In this case, it has no place in your inventory.

Pro tip: Get in the habit of checking this point on your purchase invoices. Omitting in-transit stock that belongs to you means undervaluing your stock. The result? Your profit is artificially reduced, which can cost you dearly in the event of a tax audit.

The complex handling of customer returns

Returns are part of daily life for every online seller. Their accounting treatment as closing approaches is a genuine point of vigilance.

Imagine a product returned by a customer just before December 31st. Three scenarios can arise:

  • The product is intact and put back up for sale: This is the simplest case. The product returns to stock. It must be recorded in the closing inventory at its original acquisition cost, and definitely not at its selling price.
  • The product is slightly damaged but resellable at a discount: It does return to stock, but a write-down must be recorded to reflect its loss in value. More on this shortly.
  • The product is unsellable: It must not be counted in the closing stock. Its value is a straight loss for the business, already factored into the cost of goods sold.

Write-downs for items losing value

Your stock doesn’t always retain the same value between the moment you buy it and the inventory date. That’s obvious. A past-season clothing collection, food products nearing their expiration date, or a smartphone model that’s become obsolete have all lost part of their market value.

Accounting rules require you to recognize this potential loss through a provision for inventory write-down. Concretely, this provision reduces the value of your stock on the balance sheet’s asset side. It’s also a deductible expense that reduces your taxable result. Ignoring write-downs simply means overstating the value of your business.

Specifics for D2C manufacturers and work in progress

If you’re a D2C (Direct-to-Consumer) brand that manufactures its own products, another type of stock comes into play: work in progress. These are products that are neither quite raw materials nor yet finished products.

Let’s take a concrete example: you make handcrafted candles. On December 31st, you have hundreds of candles where the wax has been poured, but the wick and fragrance are still missing. This “work in progress” has a value, corresponding to the cost of raw materials and labor already incurred. It absolutely must be valued and included in your closing stock.

Calculating the value of this work in progress may seem a bit complex, but it’s essential for obtaining an accurate picture of your performance and the health of your balance sheet.

What if we let a tool do the calculation for us?

After breaking down the manual calculation, you quickly realize one thing: every step is a potential source of error. This is precisely where automation comes in, turning a task that can quickly become a headache into a reliable, near-instant process.

A pensive businessman looks at data flows between a laptop, boxes, and inventory management icons.

A platform like Bizyness, for example, was designed specifically for online sellers. The stock calculation logic is built directly into the core of the system. The tool doesn’t just do a subtraction; it orchestrates the entire financial flow surrounding your merchandise.

By connecting to your sales channels (Shopify, WooCommerce, Amazon…) and payment processors like Stripe, the platform tracks every stock movement in near real time. A sale? A return? A restock? Everything is recorded automatically.

Concretely, what does this change for you?

The impact on day-to-day management is immediate. Say goodbye to the risks and heaviness of spreadsheets and focus on more strategic tasks.

Here are the most obvious benefits:

  • Finally reliable numbers. The risk of human error is virtually eliminated. No more typos or broken formulas distorting the balance sheet.
  • A phenomenal time saving. What could take hours, even days, at month-end or quarter-end is now available in a few clicks. That time can be reinvested in growing your store.
  • Tax peace of mind. The system generates accounting entries compliant with the General Chart of Accounts and prepares the data needed for your Accounting Records File (FEC).

The typical case of the multichannel seller

Imagine for a moment an online seller who sells on their Shopify site and via Amazon’s FBA program. Doing it by hand, they’d have to juggle between the two platforms, consolidate sales, manage different logistics costs, and make sure their valuation method is applied consistently everywhere. That’s a monumental task.

With an automated solution, the platform centralizes all this information. It applies the defined valuation method (WAC, for example) across all stock, regardless of location, and generates the end-of-period accounting entries. The financial report is ready to be sent to the accountant, with virtually no effort.

This integrated approach has become essential for having a clear and accurate view of profitability. Of course, for those just starting out, a free inventory management software can already be an excellent first step in laying the groundwork, before moving on to more advanced automation.

Today, automating the stock variation calculation is no longer a luxury. It’s a necessity for every online seller who wants to secure their management and drive growth on sound financial foundations.

A few frequently asked questions about stock variation

Even with the formula in mind, practical cases often raise questions. Here are direct answers to the most common questions online sellers ask, to help you finalize your calculations with confidence.

Can you change your valuation method along the way?

The golden rule in accounting is consistency of methods. The General Chart of Accounts insists on this principle for a simple reason: to ensure your company’s performance can be compared from one year to the next. Changing methods, for example switching from WAC to FIFO, is therefore not a decision to be taken lightly.

Such a change must remain exceptional. If you do make it, you’ll need to justify it very precisely in the notes to your balance sheet and quantify its impact. Needless to say, this is a topic to discuss with your accountant before proceeding.

A change of method is not a simple management adjustment. It’s a decision that changes how your company’s performance is read, and it demands absolute rigor.

And for dropshipping, how does it work?

That’s the beauty of the model! In dropshipping, you don’t own the stock. You’re an intermediary, a connector between buyer and seller.

The consequence is simple: no stock appears on the asset side of your balance sheet. You therefore simply have no stock variation calculation to do. Your accounting is lighter as a result, since your main expenses are the purchases of the products you resell, full stop.

Should shipping costs be included in the stock value?

Yes, without the slightest hesitation. The value of a product in stock isn’t limited to its supplier purchase price. You must add all costs incurred to bring it to your warehouse.

Be sure to include:

  • Transport costs (whether by ship, truck, or otherwise).
  • Any customs duties.
  • Non-recoverable taxes.

Forgetting these costs means undervaluing your stock. And an undervalued stock means a gross margin and a result that don’t reflect reality.


Ready to say goodbye to manual calculations and costly errors? Bizyness automates your entire financial management, from stock tracking to generating accounting entries. Discover how our platform simplifies accounting for your e-commerce business at the Bizyness website.