To calculate profit and loss in the stock market, subtract the total purchase cost of your shares from the sale proceeds. Then deduct brokerage, Securities Transaction Tax (STT), GST, stamp duty, and other applicable charges to estimate your net trading profit or loss.
Stock profit and loss formula:
Gross P&L = Selling Value − Purchase Value
Net P&L = Gross P&L − Trading Charges
For example, if you buy 100 shares at ₹250 each and sell them at ₹275 each:
- Purchase value: ₹25,000
- Selling value: ₹27,500
- Gross profit: ₹2,500
- Gross return: 10%
Your actual profit will be lower after applicable trading charges and taxes.
What Is Profit and Loss in the Stock Market?
- Profit: You sell shares for more than their purchase cost.
- Loss: You sell shares for less than their purchase cost.
- Realised P&L: Profit or loss from shares you have sold.
- Unrealised P&L: The current estimated gain or loss on shares you still hold.
Stock Market Profit and Loss Formula
1. Gross Profit or Loss
Gross P&L = (Selling Price − Buying Price) × Quantity
If you buy 50 shares at ₹200 and sell them at ₹230:
(₹230 − ₹200) × 50 = ₹1,500 gross profit.
If you sell at ₹180 instead:
(₹180 − ₹200) × 50 = −₹1,000 gross loss.
2. Profit Percentage on Shares
Profit Percentage = (Profit ÷ Purchase Cost) × 100
If purchase cost is ₹20,000 and gross profit is ₹2,000, the gross return is 10%.
Net Return % = (Net Profit ÷ Total Investment Cost) × 100
How to Calculate Stock Market Profit and Loss in Rupees: Example
| Details | Amount |
| Shares purchased | 100 |
| Buying price per share | ₹250 |
| Selling price per share | ₹275 |
| Purchase value | ₹25,000 |
| Sale value | ₹27,500 |
| Gross profit | ₹2,500 |
Step 1: Calculate Purchase Value
100 × ₹250 = ₹25,000
Step 2: Calculate Selling Value
100 × ₹275 = ₹27,500
Step 3: Calculate Gross Profit
₹27,500 − ₹25,000 = ₹2,500
Step 4: Calculate Gross Profit Percentage
₹2,500 ÷ ₹25,000 × 100 = 10%
Note: This is gross profit. Brokerage, STT, GST, stamp duty, exchange charges, and other applicable costs must be considered to estimate net trading profit.
How to Calculate Average Buying Price of Shares
When you buy the same stock multiple times at different prices, use a weighted average.
Average Buying Price = Total Purchase Value ÷ Total Shares Purchased
| Purchase | Quantity | Price | Purchase Value |
| First purchase | 10 | ₹100 | ₹1,000 |
| Second purchase | 20 | ₹120 | ₹2,400 |
| Total | 30 | | ₹3,400 |
₹3,400 ÷ 30 = ₹113.33 per share, before charges included in the cost basis.
Do not simply average ₹100 and ₹120, because the quantities purchased were different.
Absolute Return vs CAGR vs XIRR
Absolute Return
Absolute Return = [(Ending Value − Beginning Value) ÷ Beginning Value] × 100
If ₹50,000 becomes ₹60,000, the absolute return is 20%. This does not account for the investment period.
CAGR: Compound Annual Growth Rate
CAGR = (Ending Value ÷ Beginning Value)^(1/n) − 1
Here, n is the investment period in years.
If ₹50,000 becomes ₹60,000 in two years:
(60,000 ÷ 50,000)^(1/2) − 1 ≈ 9.54% per year.
CAGR is useful when there is one initial investment and one final value. It does not show volatility or the path of returns.
XIRR for Multiple Investments
XIRR calculates an annualized return using the timing and size of cash flows.
=XIRR(values, dates)
Use negative values for investments and positive values for cash received or final portfolio value. XIRR is useful for staggered investments and withdrawals.
Realised vs Unrealised Profit and Loss
| Type | Meaning | Example |
| Realised profit | Profit on shares sold | Bought at ₹100, sold at ₹120 |
| Realised loss | Loss on shares sold | Bought at ₹100, sold at ₹90 |
| Unrealised profit | Current gain on shares still held | Buy ₹100, market price ₹120 |
| Unrealised loss | Current loss on shares still held | Buy ₹100, market price ₹90 |
Unrealised P&L can change with the market price and is not guaranteed profit.
Trading Charges That Affect Your Net Profit in India
Common charges include brokerage, STT, GST, stamp duty, exchange transaction charges, SEBI turnover fees, DP charges, and other broker-specific fees.
| Charge | Equity Delivery | Equity Intraday | Usually Paid By |
| STT | 0.1% on buy and sell | 0.025% on sell side | Buyer/seller as applicable |
| Stamp duty | 0.015% on buy side | 0.003% on buy side | Buyer |
| SEBI turnover fee | ₹10 per crore | ₹10 per crore | Applicable sides |
| GST | 18% on taxable service charges | 18% on taxable service charges | Client |
| Brokerage | Broker-specific | Broker-specific | Client |
| Exchange transaction charges | Exchange-specific | Exchange-specific | Client |
| DP charges | Broker/depository-specific, often on delivery sale | Usually not applicable | Client |
Check NSE charges and levies for current statutory rates.
GST is not charged on the share purchase value itself. It applies to taxable brokerage and related services/charges. The GST rate on brokerage services is 18%. See the CBIC GST FAQ.
How to Calculate Net Profit After Brokerage and STT
Suppose gross profit is ₹2,500 and total charges shown in your contract note are ₹80.
Net Trading Profit = ₹2,500 − ₹80 = ₹2,420
The ₹80 is illustrative, not a universal estimate. Actual charges depend on broker, exchange, order size, and transaction type.
Intraday Profit and Loss Calculation
For a long intraday trade:
Gross Profit = (Sell Price − Buy Price) × Quantity
Example: Buy 200 shares at ₹150 and sell at ₹154.
(₹154 − ₹150) × 200 = ₹800 gross profit.
Subtract applicable brokerage, STT, GST, exchange charges, stamp duty, and other fees to estimate net profit.
Delivery vs Intraday Profit Calculation
| Feature | Delivery | Intraday |
| Shares held overnight | Yes, possible | No |
| Demat delivery | Usually | No |
| STT | 0.1% on buy and sell | 0.025% on sell side |
| Stamp duty | 0.015% on buy side | 0.003% on buy side |
| DP charges | May apply on sale | Usually not applicable |
F&O Profit and Loss Calculation
Futures P&L
Futures P&L = (Exit Price − Entry Price) × Quantity
For a short position, the direction is reversed. P&L depends on contract quantity and price movement, not just margin deposited.
Options P&L
For a bought option:
Gross P&L = (Exit Premium − Entry Premium) × Quantity
Example: Buy an option at ₹100 premium and sell it at ₹130, with quantity 50.
(₹130 − ₹100) × 50 = ₹1,500 gross profit.
This simple formula applies to a closed long-option position. Multi-leg strategies, expiry settlement, exercise, and short options require more detailed calculations.
From 1 April 2026, STT on futures sold is 0.05%, STT on options sold is 0.15% of premium, and exercised options are subject to 0.15% STT on intrinsic value. See NSE’s STT update.
Capital Gains Tax on Shares in India
Trading profit and taxable income are not necessarily the same. Tax depends on whether shares are held as investments or traded as business activity, holding period, transaction type, and applicable law.
The Income-tax Act, 2025 came into effect on 1 April 2026. The following is a general guide for qualifying listed equity shares.
Short-Term Capital Gains (STCG)
- Shares held for 12 months or less are generally short-term.
- Qualifying listed equity STCG is generally taxed at 20% for transfers on or after 23 July 2024, subject to applicable STT conditions.
Long-Term Capital Gains (LTCG)
- Shares held for more than 12 months are generally long-term.
- Qualifying listed equity LTCG is generally taxed at 12.5% on eligible aggregate gains exceeding ₹1.25 lakh in the relevant tax year.
Surcharge and cess may apply. Conditions and exceptions matter. See the Income Tax Department share taxation guide and the Income-tax Act, 2025.
Intraday Trading Tax
Intraday equity trading is generally treated as speculative business income rather than capital gains.
F&O Tax
F&O trading is generally treated as non-speculative business income, subject to the facts and applicable law. Business income is taxed under the applicable income-tax rules rather than automatically at special capital gains rates.
Frequent trading, leverage, and substantial intraday or F&O activity may require professional tax advice. Classification depends on facts.
How to Set Off Stock Market Losses
Capital Gains Losses
- Short-term capital loss can generally be adjusted against short-term or long-term capital gains.
- Long-term capital loss can generally be adjusted only against long-term capital gains.
- Eligible capital losses can generally be carried forward for up to eight tax years, subject to conditions.
Filing the return within the applicable due date is important to preserve the right to carry forward losses.
Intraday Trading Losses
Speculative business losses generally can be set off only against speculative business profits and may be carried forward for up to four tax years, subject to filing conditions.
F&O Losses
F&O losses are generally non-speculative business losses and follow business-loss rules. Their treatment differs from capital losses and intraday speculative losses.
See the Income Tax Department loss set-off guidance.
How to Check Profit and Loss in Zerodha, Groww, and Upstox
Zerodha P&L Report
- Log in to Zerodha Console.
- Open Reports.
- Select P&L.
- Choose the segment and date range.
- Select realised, unrealised, or combined P&L.
- Download the report.
Zerodha P&L report instructions
Groww P&L Report
- Open your profile.
- Select Reports.
- Choose Profit & Loss.
- Select Stocks P&L or F&O P&L.
- Select the financial year or date range.
- Click View.
Groww P&L report instructions
Upstox P&L Report
Check the current Reports or Tax section in the Upstox app or web platform and download the relevant P&L or tax statement. Menu names may change, so refer to the platform’s current help documentation.
Why Broker P&L and Tax P&L May Differ
A broker’s P&L may not include every item relevant to your tax return, including corporate actions, shares transferred between brokers, other broker accounts, tax classification, loss carry-forward, and tax adjustments.
Use broker reports as records and reconcile them with tradebook data, contract notes, and tax requirements.
How to Calculate Stock Market Profit and Loss in Excel
| Column | Description |
| A | Stock name |
| B | Quantity |
| C | Buy price |
| D | Sell price |
| E | Purchase value |
| F | Sale value |
| G | Gross profit/loss |
| H | Charges |
| I | Net trading P&L |
| J | Return percentage |
Purchase value in E2:
=B2*C2
Sale value in F2:
=B2*D2
Gross P&L in G2:
=F2-E2
Net trading P&L in I2:
=G2-H2
Gross return percentage in J2:
=IFERROR(G2/E2,0)
Format column J as a percentage. Use actual charges for a more accurate estimate.
Use a Stock Profit and Loss Calculator on ToolsNCalc
A stock profit calculator can help estimate purchase value, selling value, gross P&L, profit percentage, average buying price, trading charges, and net trading P&L.
For an Indian stock calculator, users should be able to enter quantity, buying price, selling price, and transaction type.
If the calculator excludes broker-specific fees, STT, stamp duty, GST, and DP charges, it should clearly label its output as gross profit or an estimate.
Explore relevant tools on ToolsNCalc.com.
Frequently Asked Questions
How do I calculate profit and loss in the stock market?
Subtract purchase value from selling value. Then deduct brokerage and applicable trading charges to estimate net trading P&L.
How do I calculate profit percentage on shares?
Divide profit by purchase cost and multiply by 100. For net return, include applicable charges.
How do I calculate net profit after brokerage and STT?
Calculate gross profit first, then subtract brokerage, STT, GST, stamp duty, exchange charges, SEBI fees, and applicable DP charges.
What is the difference between realised and unrealised profit?
Realised profit comes from selling shares. Unrealised profit is the current estimated gain on shares still held.
Is stock market profit taxable in India?
Yes, profits may be taxable. Tax treatment depends on investment or trading classification, holding period, transaction type, and applicable rules.
Is CAGR the same as absolute return?
No. Absolute return measures total percentage gain or loss. CAGR estimates annualized growth. XIRR is useful when cash flows occur on different dates.
Conclusion
Calculating stock market profit and loss is straightforward once you separate gross returns, trading charges, and tax.
Start with purchase and sale values. Calculate gross P&L and percentage return. Then subtract brokerage, STT, GST, stamp duty, exchange fees, and other applicable charges to estimate net trading profit.
Use CAGR for a single initial investment and final value, and XIRR when cash flows occur on different dates.
For Indian traders, reviewing the broker contract note and understanding tax classification are essential. A positive trading P&L does not automatically mean the same amount is your final after-tax profit.
Educational Disclaimer
This article is for educational and informational purposes only and is not investment, trading, or tax advice. Trading involves risk, and charges and tax rules can change. Verify current broker charges and official tax provisions before making decisions. Consult a qualified tax professional for individual tax filing and loss set-off questions.
Comments
Please login to post a comment.