13 min read

What is Capital Gains Tax?

Understanding capital gains tax is one of the most important concepts for any investor looking to build long-term wealth. When you buy an asset and sell it for a profit, the government wants a piece of that profit. But how much they take depends entirely on your strategy, your income, and how long you held the asset.

The Basics: What Exactly is a Capital Gains Tax?

A capital gains tax is a tax imposed on the profit realized from the sale of an asset. But the phrase "profit realized from the sale" is what trips up most beginner investors.

Let's define the two most important terms in investing and taxation: Realized and Unrealized.

Unrealized Gains vs. Realized Gains

If you purchase a share of stock for $100 and it grows to $150 over the next year, you have made a $50 "profit" on paper. However, because you haven't sold the stock, that $50 is an unrealized gain. You do not owe any capital gains tax on this $50 growth.

It's only when you press the "sell" button and convert that stock back into cash that the gain becomes realized. That is the moment the IRS takes notice and a tax event occurs.

Capital gains don't just apply to stocks. They apply to almost any asset you buy and sell for a profit, including:

While the concept is straightforward—make a profit, pay a tax—the actual rate you pay is determined by a single, crucial factor: time.

Short-Term vs. Long-Term Capital Gains Tax Rates

The IRS heavily incentivizes long-term investing. The tax code essentially penalizes you for trading in and out of stocks quickly, and rewards you for buying and holding.

The time you hold an asset before selling it dictates which of two categories your tax rate falls into:

1. Short-Term Capital Gains (Held for 1 year or less)

If you buy a stock and sell it for a profit 365 days later (or sooner), the profit is considered a short-term capital gain. Short-term capital gains do not have their own special tax brackets. Instead, the profit is simply added to your ordinary income for the year and taxed at your standard federal income tax bracket.

For high earners, this means short-term capital gains can be taxed at up to 37% at the federal level, not including state taxes.

Short-Term Example

Imagine your ordinary income places you in the 24% tax bracket. If you buy 100 shares of a company for $10,000 and sell them six months later for $15,000, your $5,000 profit is a short-term capital gain.

Because you held the asset for less than a year, that $5,000 is taxed at your ordinary income rate of 24%. You will owe $1,200 in taxes on this trade.

2. Long-Term Capital Gains (Held for more than 1 year)

If you hold an asset for 366 days or more before selling it, the profit is categorized as a long-term capital gain. This is where the magic of the tax code happens for investors.

Long-term capital gains benefit from significantly lower, preferential tax rates. Depending on your taxable income and filing status, your long-term capital gains rate will be 0%, 15%, or 20%.

Long-Term Capital Gains Rate Who pays it? Why it matters
0% Lower-income earners (Single filers earning roughly under $47,025 in 2024) You pay no federal tax on your investment profits. This is a massive wealth-building tool for lower-income investors.
15% Most middle-to-high income earners (Single filers earning between ~$47,025 and ~$518,900 in 2024) This is the rate the vast majority of investors pay. It is often significantly lower than their ordinary income tax rate.
20% Highest income earners (Single filers earning over ~$518,900 in 2024) Even the wealthiest investors pay a maximum base rate of 20%, which is nearly half the top ordinary income tax bracket of 37%.

Note: Very high earners may also be subject to an additional 3.8% Net Investment Income Tax (NIIT), pushing the top effective federal rate to 23.8%. State taxes may also apply.

Long-Term Example

Let's take the same scenario as before: you buy $10,000 of stock and it grows to $15,000. But this time, you wait 13 months before selling it.

Your $5,000 profit is now a long-term capital gain. If your income places you in the 15% long-term bracket, you will owe $750 in taxes on this trade.

Simply by waiting a few extra months to hit the one-year mark, you saved $450 in taxes.

This is why day traders face an incredibly steep uphill battle. Every successful trade they make is taxed at the highest possible rate (ordinary income), creating a massive drag on their compound growth compared to a long-term buy-and-hold investor.

Real-World Example: Calculating Capital Gains with Apple (AAPL)

Let's walk through exactly how this works with a real-world company, using historical data to highlight the power of holding for the long term and the danger of short-term trading.

Scenario 1: The Short-Term Trader

Imagine you bought $10,000 worth of Apple (AAPL) stock on January 3, 2023. Apple was trading at approximately $125 per share, giving you exactly 80 shares.

By July 19, 2023 (just over six months later), Apple stock had surged to approximately $195 per share. The value of your 80 shares is now $15,600.

You decide to take your profits and sell all 80 shares.

The Tax Calculation

  • Proceeds (Sale Price): $15,600
  • Cost Basis (Purchase Price): $10,000
  • Capital Gain (Profit): $5,600

Because you held the stock for only six months, this is a short-term capital gain.

If you are a single filer with a taxable income of $80,000, your ordinary federal income tax bracket is 22%.

Your federal tax owed: $1,232 (22% of $5,600).

Your after-tax profit: $4,368.

Scenario 2: The Long-Term Investor

Now, imagine a different scenario. You bought the same $10,000 worth of Apple (AAPL) stock on January 3, 2023 (80 shares at $125).

You held the stock through the end of 2023 and into 2024. Let's say you decide to sell your 80 shares on January 24, 2024. On that date, Apple was trading at approximately $195 per share—the exact same price as our short-term scenario.

The Tax Calculation

  • Proceeds (Sale Price): $15,600
  • Cost Basis (Purchase Price): $10,000
  • Capital Gain (Profit): $5,600

Because you held the stock for more than a year (386 days), this is a long-term capital gain.

If you are the same single filer with a taxable income of $80,000, your long-term capital gains bracket is 15%.

Your federal tax owed: $840 (15% of $5,600).

Your after-tax profit: $4,760.

The takeaway: By simply holding the stock for an additional six months before selling at the exact same price, the long-term investor saved $392 in federal taxes—increasing their after-tax profit by nearly 10%.

How to Calculate Your Cost Basis

In the Apple example above, calculating the profit was simple. We subtracted the purchase price ($10,000) from the sale price ($15,600). The original purchase price is called your cost basis.

But what if you didn't buy all your shares at once? What if you bought $1,000 of Apple stock every month for two years?

If you buy shares of the same company at different times and at different prices, you will have multiple "tax lots." When you eventually decide to sell some (but not all) of those shares, you have to decide which shares you are selling.

This is where cost basis accounting methods come into play. Most brokerages default to one of two methods:

1. First-In, First-Out (FIFO)

This is the default method for almost every major brokerage. When you sell shares, the brokerage assumes you are selling the oldest shares you bought first.

Why it matters: FIFO is generally best for ensuring your shares qualify for long-term capital gains rates. Because it sells your oldest shares first, those shares are the most likely to have been held for more than a year.

2. Specific Identification (Spec ID)

This method allows you to log into your brokerage account and manually select exactly which shares (or "tax lots") you want to sell.

Why it matters: If you bought shares of a stock at high prices and low prices, you might want to specifically sell the shares you bought at the highest price. Why? Because the higher the purchase price, the lower your profit (capital gain) will be when you sell, minimizing your tax bill.

Understanding cost basis is essential because the IRS only taxes you on the difference between the sale price and the cost basis. If you can legally raise your cost basis (by selecting higher-priced shares to sell), you can lower your capital gains tax.

Strategies to Minimize Capital Gains Tax

Now that you understand what capital gains tax is and how it works, the next logical step is to learn how to legally minimize it. The U.S. tax code is filled with incentives for investors to keep their money invested and grow their wealth.

1. The Holding Period Rule (Buy and Hold)

The simplest and most effective strategy for the vast majority of investors is to simply hold onto your investments for at least one year and a day before selling.

This strategy alone drops your tax rate from ordinary income (up to 37%) to long-term capital gains rates (0%, 15%, or 20%). Over a lifetime of investing, the difference between short-term trading and long-term investing can be hundreds of thousands, if not millions, of dollars in tax savings.

2. Tax-Loss Harvesting

Tax-loss harvesting is a powerful tool used by advanced investors to offset their capital gains with capital losses.

If you have an investment that has lost money (an unrealized loss) and another investment that has made money (an unrealized gain), you can strategically sell the losing investment to create a "realized loss." You then sell the winning investment to create a "realized gain."

How Tax-Loss Harvesting Works

Imagine you have realized $10,000 in long-term capital gains this year by selling Stock A.

You also own Stock B, which has performed poorly and is down $8,000 from your original purchase price. You decide to sell Stock B, realizing an $8,000 capital loss.

When you file your taxes, the IRS allows you to subtract your capital losses from your capital gains. Instead of owing taxes on $10,000, you will only owe taxes on your net gain of $2,000 ($10,000 gain minus $8,000 loss).

But what if your losses exceed your gains? The IRS allows you to use up to $3,000 in net capital losses to offset your ordinary income each year (e.g., your salary). If your net losses are greater than $3,000, you can carry the remaining balance forward to future tax years indefinitely.

Beware the Wash-Sale Rule

If you use tax-loss harvesting, you must be extremely careful of the IRS "Wash-Sale Rule."

This rule states that if you sell an investment at a loss to harvest the tax benefit, you cannot buy a "substantially identical" investment within 30 days before or after the sale.

If you do, the IRS will disallow the capital loss, and you will not get the tax deduction. For example, you cannot sell shares of the S&P 500 ETF (SPY) at a loss and buy them back the next day just to get the tax write-off.

3. Utilize Tax-Advantaged Accounts

The ultimate way to avoid capital gains tax is to use accounts specifically designed by the government to shield your investments from taxes. These accounts come with restrictions on when you can withdraw the money, but the tax benefits are immense.

4. Donate Appreciated Assets

If you are charitably inclined, donating an asset that has gone up in value is significantly more tax-efficient than selling the asset, paying capital gains tax, and donating the cash.

If you donate a stock you have held for more than a year directly to a 501(c)(3) charity, you never have to pay capital gains tax on the appreciation. Furthermore, you can take a tax deduction for the full fair market value of the stock on the day you donated it.

Frequently Asked Questions About Capital Gains Tax

What exactly is a capital gains tax?

Capital gains tax is a tax on the profit realized from the sale of a non-inventory asset that was purchased for a lower price. The most common capital gains are realized from the sale of stocks, bonds, precious metals, real estate, and property.

How is the capital gains tax rate determined?

The capital gains tax rate is determined by how long you held the asset before selling it and your taxable income. Assets held for a year or less are subject to short-term capital gains tax, which equals your ordinary income tax rate. Assets held for more than a year are subject to long-term capital gains tax rates, which are typically 0%, 15%, or 20% depending on your income.

Do I have to pay capital gains tax if I don't sell?

No, capital gains are not taxed until they are realized, meaning you must sell the asset for a profit before the tax applies. Unrealized gains (when an asset has increased in value but you still own it) are not subject to capital gains tax.

Can I use capital losses to offset capital gains?

Yes, through a strategy called tax-loss harvesting, you can sell assets at a loss to offset the taxes you owe on capital gains. If your capital losses exceed your capital gains, you can use up to $3,000 of those losses to offset ordinary income in a given tax year, and carry forward any remaining losses to future years.

Are dividends taxed as capital gains?

Qualified dividends are taxed at the more favorable long-term capital gains rates (0%, 15%, or 20%). Non-qualified (or ordinary) dividends are taxed at your ordinary income tax rate, similar to short-term capital gains.

Data Sources & Methodology

Tax and retirement account information based on current IRS/CRA regulations and guidelines. Consult a qualified tax professional for advice specific to your situation.

Cite This Page

Westmount Fundamentals. "What is Capital Gains Tax? A Complete Guide for Investors." westmountfundamentals.com/what-is-capital-gains-tax, 2026.

Related Pages

Free Capital Gains Tax Calculator & Estimator (2024-2025 Rat Working Capital Efficiency Rankings 2026 Tax Loss Harvesting Explained: Turn Losing Stocks Into Ta... Tax-Efficient Investing: Complete Strategy Guide