- What Is Trading and How Does Trading Work?
- Trading Fundamentals: A Guide for Beginners
- Trading vs. Investing: What Are the Key Differences?
- Trading Terms and Terminologies Every Beginner Should Know
- Common Trading Mistakes Beginners Make and How to Avoid
- Understanding Risk and Reward in Trading: A Complete Guide
- Guide to the Different Types of Financial Markets
- Investment Basics: Definition, Strategies, and How to Invest
- Benefits of Investing: Financial Growth and Security
- What Is Swing Trading? A Practical Guide For Beginners
- What Is Spot Trading? A Guide for Beginners
- What Are Futures in Trading? A Guide for Beginners
- Understanding Bull Markets: Growth & Strategy
- How to Read a Candlestick Chart: A Guide for Beginners
- Is Trading Gambling? The Truth About Risk
- Pip in Forex: How It Works & How to Calculate It
- What Is the Bid-Ask Spread in Trading? A Guide for Beginners
- What Is a Margin Call? A Guide for Beginners
- Market Volatility Explained: What It Is and How to Trade It
- Drawdown in Trading: Meaning, Math, and Risk
- Understanding Slippage in Trading: Causes and Control
- Forex Lot Size Explained: Standard, Mini & Micro
- Trailing Stop vs Stop Loss: Essential Risk Strategy
- How Asset Allocation Works: Strategies Explained
- Understanding Market Trading Hours & Sessions
- Market Makers Explained: A Trader's Guide
- Portfolio Diversification: A Strategy Guide
- Capital Gains Explained: How Investment Taxes Work
- Stock Market Circuit Breakers: How Trading Halts Work
- What Is an IPO? How Initial Public Offerings Work
- What Is a Secondary Market? A Complete Guide
- What Is a Stock Exchange? Functions and Overview Explained
- Understanding Ticker Symbols: A Market Guide
- How Clearing Houses Work in Financial Markets

You log into your portfolio and notice that the share of tech stock you bought a few months ago for $1,000 is now trading at $1,500. It is a satisfying moment—you have made $500 in paper profits. But when you hit the "Sell" button to lock in that return, you are no longer just managing an investment; you are entering the world of capital gains.
Capital gains are profits earned when you sell an investment for more than you paid, while dividend income may be taxed differently depending on your jurisdiction. Understanding how those gains are categorized and taxed determines how much of that profit actually stays in your bank account.
It represents the positive difference between what you paid for an asset and what you sell it for. Whether you trade stocks, bonds, cryptocurrencies, or real estate, grasping the mechanics of capital gains is essential for managing your overall investment strategy and keeping tax surprises at bay.
How Capital Gains Work: Realized vs. Unrealized Gains
Before calculating your tax obligations, you must understand the distinction between an unrealized gain and a realized gain. An unrealized gain—often referred to as a "paper gain"—occurs while you still hold the asset. If your stock position jumps by $500 today, that profit is strictly theoretical, since the market could swing downward tomorrow and erase those gains.
You do not owe taxes on unrealized gains, because no formal transaction has taken place.
A realized gain occurs the exact moment you finalize the sale of your asset. Once the transaction completes, the profit is locked in, transforming your paper gains into taxable capital gains.

A Real-World Worked Scenario
To see how this works in practice, let us walk through a typical stock transaction:
- The Purchase: You buy 100 shares of Company ABC at $50 per share. Your total initial investment is $5,000.
- The Growth: Over six months, Company ABC grows, and the price rises to $80 per share. Your portfolio value is now $8,000, creating an unrealized gain of $3,000 ($8,000 - $5,000).
- The Sale: You decide to sell all 100 shares at $80 per share, receiving $8,000 in cash.
- The Result: You have officially locked in a realized capital gain of $3,000. This $3,000 is the taxable amount reported to tax authorities at the end of the year.
Knowing when a gain transitions from unrealized to realized allows you to control the timing of your tax liabilities intentionally.
Short-Term vs. Long-Term Capital Gains
Not all profits are taxed equally. Tax authorities categorize capital gains based on your holding period—how long you owned the asset before selling it.
- Short-Term Capital Gains: Are generated when you sell an asset after holding it for one year or less. In the United States, these gains are generally taxed as ordinary income, meaning they are subject to the same federal tax brackets as wages and other earned income — check IRS.gov for the current-year brackets, as they are adjusted periodically. For the highest-income taxpayers, the top marginal federal rate is 37% (based on current federal tax brackets; always confirm the latest rates on IRS.gov, as they are adjusted periodically). An additional 3.8% Net Investment Income Tax (NIIT) may also apply above certain income thresholds.
- Long-Term Capital Gains: Apply when you hold an asset for more than one year before selling. In the United States, these gains generally receive preferential federal tax rates of 0%, 15%, or 20% based on current tax law, depending on your taxable income, making them lower than ordinary income tax rates for many investors — always confirm the current-year thresholds on IRS.gov, as they are adjusted periodically.

Choosing to hold an asset for 366 days instead of 365 can substantially reduce your tax burden. For instance, an investor in a high-income bracket earning $10,000 on a short-term trade might pay up to $3,700 in taxes, whereas holding that same position for over a year could cap the tax bill at $2,000. Incorporating holding periods into your overall market approach may help you preserve more of your total returns over time, though the right approach depends on your individual financial situation, goals, and risk tolerance.
How Is Capital Gains Tax Calculated?
Calculating your taxable profit requires determining your cost basis. Your cost basis is the total purchase price of the asset, adjusted for transaction costs like broker commissions and trading fees.
The standard calculation formula is straightforward:
Net Capital Gain = (Selling Price - Purchase Price) x Number of Units - Total Transaction Fees
Example Calculation
Let us assume you buy 200 shares of an ETF (Exchange-Traded Fund) at $100 per share, paying a $10 commission fee. Later, you sell all 200 shares at $140 per share, paying another $10 commission fee.
- Gross Proceeds: 200 x $140 = $28,000
- Initial Purchase Cost: 200 x $100 = $20,000
- Total Transaction Fees: $10 (buy) + $10 (sell) = $20
- Adjusted Cost Basis: $20,000 + $20 = $20,020
- Net Taxable Capital Gain: $28,000 - $20,020 = $7,980
By factoring trading commissions into your cost basis, you reduce your taxable profit from $8,000 down to $7,980. Keeping diligent records of all trading fees ensures you never pay tax on money spent simply executing trades.
Capital Losses and Tax-Loss Harvesting
Investing does not always yield a profit. When you sell an asset for less than its adjusted cost basis, you incur a capital loss. Fortunately, capital losses offer a useful tax advantage: they can be used to offset your capital gains.
If you make a $5,000 gain on one stock trade but realize a $2,000 loss on another within the same tax year, your taxable capital gain drops to $3,000 ($5,000 - $2,000).

If your total capital losses exceed your capital gains for the year, per IRS Topic No. 409, you can generally deduct up to $3,000 of the net loss ($1,500 if married filing separately) against your ordinary taxable income for US federal tax purposes. Any remaining unused loss can be carried forward indefinitely to offset future capital gains and, if applicable, future ordinary income, subject to the same annual deduction limit.
This strategy—actively selling underperforming assets at a loss to minimize overall tax liability—is known as tax-loss harvesting. It provides a practical way to balance portfolio asset allocation while mitigating tax exposure during down markets.
The Bottom Line
Capital gains are the main engine of long-term wealth creation, but generating profits is only half the equation—managing the resulting tax obligations is equally important. By understanding the distinction between paper profits and realized gains, monitoring your holding periods, tracking your cost basis accurately, and utilizing capital losses strategically, you can retain more of your investment profits over time. Before making major portfolio changes, consider consulting a qualified tax professional to tailor these concepts to your specific financial situation.
Disclaimer: The content on this page is intended for educational and informational purposes only. It does not constitute financial, investment, tax, or legal advice, and should not be interpreted as a recommendation to buy, sell, or hold any financial instrument or asset. Trading and investing involve significant risk, including the possible loss of your entire capital. Products such as forex, CFDs, and cryptocurrencies carry additional risks due to leverage, high volatility, and limited regulatory protection in some jurisdictions. Past performance of any financial instrument does not guarantee future results. Any market views, forecasts, or opinions expressed are those of the author at the time of writing and may not reflect current market conditions. Platform features, fees, and regulatory status are subject to change — always verify information directly with the relevant provider or regulator before making any financial decision. BrokerSpecs may receive compensation from third parties featured on this site. Always conduct your own due diligence and consider seeking advice from a licensed financial professional before investing.

