Most people jump into stocks hoping to make money, but very few know how to actually measure whether they did. And that gap between what you think you earned and what you actually took home is exactly where surprise losses hide.
This guide walks you through every part of stock profit calculation in plain, simple language. Whether you’re brand new to investing or just looking to sharpen your numbers, this is the only resource you’ll need.
What Is Stock Profit?
Stock profit is the money you make when you sell a share for more than you paid for it. Simple enough. But the real number of your actual profit includes a few more pieces than just the buying and selling price.
There are two things that make up your total return from a stock:
- Capital gain: The difference between what you sold the stock for and what you originally paid.
- Dividend income: Some companies pay out a portion of their profits to shareholders on a regular basis. If you hold such a stock, this adds to your total return even before you sell.
True profit only becomes yours once you sell. Until then, it’s just a number on a screen.
Realized vs. Unrealized Profit — Why It Matters
This is one of the most important distinctions in all of stock investing, and it trips up a lot of beginners.
- Unrealized profit (also called a “paper gain”) is the increase in value of a stock you still hold. If you bought a share at ₹100 and it’s now worth ₹150, you have an unrealized profit of ₹50 per share. It looks great, but it is not yet yours. The market can go up or down tomorrow, and that number changes every second the market is open.
- Realized profit is what happens the moment you sell. You lock in the gain (or loss) and the money actually hits your account. This is the number that matters for taxes and for measuring your real performance.
Here’s a quick example to make it concrete:
You buy 1,000 shares of a stock at ₹100 each. By mid-year, the price climbs to ₹150. Your unrealized profit is ₹50,000. But three months later the price dropped to ₹90. If you had sold at ₹90, you would have a realized loss of ₹10,000 even though you were sitting on a paper gain earlier.
The difference is important for taxes too. You only owe taxes on realized gains, not on paper gains. And if you realize a loss, you may be able to use that loss to reduce the tax you owe on other gains.
The Basic Formula to Calculate Stock Profit
Here is the core formula, step by step:
Step 1: Calculate Gross Profit (in rupees/dollars):
Gross Profit = (Selling Price – Purchase Price) × Number of Shares
Step 2: Subtract Fees and Commissions:
Net Profit = Gross Profit – Total Trading Fees
Step 3: Calculate Percentage Return:
Percentage Return = (Net Profit ÷ Total Cost) × 100
Let’s see this in action.
Say you buy 100 shares of Company X at ₹200 per share. Your total cost is ₹20,000. A few months later you sell all 100 shares at ₹230 each. Your total proceeds are ₹23,000.
- Gross Profit = (₹230 – ₹200) × 100 = ₹3,000
- Suppose you paid ₹100 in brokerage fees for both the buy and sell combined.
- Net Profit = ₹3,000 – ₹100 = ₹2,900
- Percentage Return = (₹2,900 ÷ ₹20,000) × 100 = 14.5%
Your true return is 14.5% not 15%. That difference might seem small, but over hundreds of trades in a year, fees quietly eat into your gains. Always calculate net profit, not gross.
How to Calculate a Stock Loss
The same formula applies when the price goes against you just expect a negative result.
You buy 100 shares at ₹200 per share (total: ₹20,000). The stock falls and you sell at ₹180.
- Gross Loss = (₹180 – ₹200) × 100 = –₹2,000
- Percentage Loss = (₹2,000 ÷ ₹20,000) × 100 = 10%
So you lose 10% of your investment. Knowing your losses in percentage terms is just as important as knowing your gains. It keeps you grounded and helps you decide when to hold and when to cut your losses.
How to Calculate the Average Share Price
If you buy the same stock multiple times at different prices, which many investors do, you need to calculate your average cost per share before you can figure out your true profit.
The formula is:
Average Share Price = Total Amount Spent ÷ Total Number of Shares Owned
Here is an example:
- First purchase: 100 shares at ₹20 = ₹2,000
- Second purchase: 100 shares at ₹30 = ₹3,000
- Total spent: ₹5,000 | Total shares: 200
- Average price: ₹5,000 ÷ 200 = ₹25 per share
Now when you sell, you compare your sale price to ₹25, not to either individual purchase price. This matters a lot for accurate profit tracking. Tools like Free Finance Tool can automatically track your average cost across multiple purchases so you always have the right number.
Read More: What is ROI and How Can It Help You Make Better Money Choices?
How Dividends Fit Into Your Total Return
Dividends are extra income that companies pay to their shareholders, separate from any price gain. If a company announces a dividend of ₹2 per share and you hold 200 shares, you receive ₹400 regardless of whether the stock price moves.
When calculating your total return, always include dividends:
Total Return = Capital Gain + Dividends Received
Or in formula form:
Total Return = (Ending Value + Dividends – Initial Cost) ÷ Initial Cost
Example: You invest ₹40,000 in 100 shares at ₹400 each. Over the year you receive ₹500 in dividends. You sell at ₹440 per share for ₹44,000.
- Capital Gain: ₹44,000 – ₹40,000 = ₹4,000
- Dividends: ₹500
- Total Profit: ₹4,500
- Total Return: (₹4,500 ÷ ₹40,000) × 100 = 11.25%
Ignoring dividends gives you an incomplete picture. Long-term investors who reinvest dividends compound their returns significantly over time.
How Stock Splits Change Your Cost Basis
A stock split does not change the value of your investment, it just divides your shares into more pieces at a lower price each.
The most common is a 2-for-1 split: you get twice as many shares, each worth half as much. But your total investment value stays the same.
What does change is your cost per share, and that directly affects your profit calculation.
Example: You own 20 shares bought at ₹300 each (total cost: ₹6,000). The company does a 3-for-1 split.
- You now own 60 shares
- Your new cost per share = ₹300 ÷ 3 = ₹100
- Total cost still = ₹6,000
If you forget this adjustment, every future profit calculation for this stock will be wrong. Most brokers update this automatically, but it’s worth knowing.
How Brokers Calculate P&L in Your Portfolio (FIFO Method)
When you buy stocks at different times and prices, your broker needs a rule to figure out which shares you sold and at what cost. Most brokers use the FIFO method — First In, First Out — meaning the shares you bought first are assumed to be the ones you sell first.
Say you:
- Buy 100 shares at ₹50 (Lot 1)
- Buy 50 more shares at ₹60 (Lot 2)
- Then sell 100 shares at ₹75
Using FIFO, the broker assumes you sold Lot 1 (the first 100 shares at ₹50):
- Sale Proceeds: 100 × ₹75 = ₹7,500
- Cost Basis: 100 × ₹50 = ₹5,000
- Realized Profit: ₹2,500
Your remaining 50 shares from Lot 2 are still open, with their own unrealized profit or loss tracked separately. This is important to understand because FIFO affects the tax you pay on each sale.
Taxes on Stock Profit — What You Need to Know
Many investors focus entirely on making a profit but forget that the government takes a share of it. Understanding the basics prevents nasty surprises at tax time.
- The key rule across most markets: you only pay tax when you realize a gain that is, when you actually sell. Paper gains are not taxed.
- Short-term vs. long-term rates: In most countries, if you sell a stock you held for less than one year, the profit is taxed at a higher rate, often as regular income. If you hold it for more than a year, you pay a lower, preferential “long-term” rate.
- This has a practical implication: sometimes it pays to wait a few extra days to cross the one-year mark before selling.
- Offsetting losses against gains: If one stock goes up and another goes down, you can offset them. Say you made ₹15,000 profit on Stock A but lost ₹10,000 on Stock B. Your taxable gain is only ₹5,000. This is why smart investors sometimes deliberately sell loss-making stocks before year-end in a strategy called tax-loss harvesting.
- Excess losses: In many jurisdictions, if your total losses exceed your gains for the year, you can use the extra loss to reduce your other taxable income, up to a set limit. Any unused loss typically carries forward to the next year.
Smart Tips to Avoid Surprise Losses
Surprise losses rarely come from bad luck. Most of the time they come from not tracking the right numbers. Here’s what to watch:
- Always calculate net profit, not gross: Brokerage fees, transaction charges, and taxes all come off the top. A trade that looks like a ₹500 profit can easily become ₹350 after fees.
- Track your average cost carefully: If you add to a position over time, your break-even point changes with every new purchase. Use a spreadsheet or Free Finance Tool to stay updated.
- Don’t confuse paper gains with real money: Until you sell, your portfolio balance is just a number that changes every day. Build the habit of calculating your actual realized returns.
- Include dividends in your return calculation: Many investors underestimate how much their total return improves when dividends are counted.
- Know which tax bracket your gains fall into: Short-term gains can be taxed significantly more than long-term ones. Factor this into your sell decisions.
- Understand the wash-sale rule (if investing internationally): Some markets prohibit you from claiming a loss if you buy back the same stock within 30 days of selling. This rule closes a loophole and can catch unprepared investors off guard.
Using Tools to Track Your Profits
Manually tracking every trade gets messy fast. A simple spreadsheet with columns for stock name, buy date, shares, buy price, sell date, sell price, and fees lets you calculate realized profit and percentage return instantly.
Dedicated portfolio trackers like Free Finance Tool go further – they can sync with your brokerage, calculate your FIFO cost basis automatically, and show your realized P&L at a glance. Whether you use a spreadsheet or an app, the goal is the same: make tracking a seamless part of your routine, not an afterthought.
Read Next: What is GST and How Do You Calculate It in 2 Minutes?
Final Thoughts
Calculating stock profit is not complicated but it does require you to look at the full picture. Buying and selling prices are just the start. Fees, dividends, average costs, stock splits, and taxes all shape your real return.
The investors who avoid surprise losses are not necessarily the ones who pick the best stocks. They’re the ones who understand their numbers clearly, track them consistently, and make decisions based on actual data, not just screen prices.
Start simple: track your next trade using the formulas in this guide. Once you see your real numbers net of fees, inclusive of dividends, adjusted for splits you’ll have a completely different (and much more accurate) view of how your investments are actually performing.
Frequently Asked Questions
Q1. What is the simplest formula to calculate stock profit?
Gross Profit = (Selling Price – Purchase Price) × Number of Shares. Subtract total fees to get your net profit.
Q2. What is the difference between realized and unrealized profit?
Unrealized profit exists only on paper – it’s the gain on stocks you still hold. Realized profit is locked in when you sell. Only realized gains are taxable.
Q3. Do I pay tax on a stock I haven’t sold yet?
No. You only owe tax on realized gains profits from trades you have actually closed. Paper gains are not taxed.
Q4. What is the FIFO method in stock trading?
First In, First Out. When you sell shares, your broker assumes the shares you bought first are the ones you sold. This affects which cost basis is used and how much tax you pay.
Q5. Does a stock split affect my profit?
A split doesn’t change the value of your investment, but it changes your cost per share. You must adjust your cost basis to keep your profit calculations accurate.

Pingback: What is GST and How Do You Calculate It in 2 Minutes? - Free Finance tool
Pingback: What is ROI and How Can It Help You Make Better Money Choices? - Free Finance tool