TaxGainsCalc

Capital Gains Tax Calculator

Updated for Tax Year 2025-2026

Stock Capital Gains Tax Calculator

Calculate the tax on your stock gains accurately. Covers individual stocks, mutual funds, ETFs, and employee stock options. Free online calculator with 2025-2026 federal tax rates.

Individual Stocks
Mutual Funds & ETFs
Employee Stock Options
100% Free

How Stock Capital Gains Are Calculated

When you sell shares of stock for a profit, the difference between your sale proceeds and your cost basis is considered a capital gain and is subject to federal (and often state) taxation. Understanding how to properly calculate your stock capital gains is essential for accurate tax reporting and effective tax planning. The calculation involves determining your cost basis, accounting for any stock splits or dividends reinvested, subtracting selling costs, and applying the correct tax rate based on your holding period and income.

Your cost basis for a stock purchase is generally the price you paid per share plus any brokerage commissions or fees at the time of purchase. If you acquired shares through a dividend reinvestment plan (DRIP), each reinvested dividend creates a new purchase with its own cost basis and holding period. When you sell a portion of your shares, you need to identify which specific shares were sold to determine the gain or loss. The method you choose for this identification can significantly affect your tax outcome.

The holding period is critical because it determines whether your gain is taxed at short-term or long-term rates. Short-term capital gains apply to shares held for one year or less and are taxed at your ordinary income rate, which can range from 10% to 37% depending on your total income. Long-term capital gains apply to shares held for more than one year and benefit from preferential rates of 0%, 15%, or 20%. The difference between short-term and long-term tax treatment can be dramatic: a $100,000 gain taxed at 37% costs $37,000, while the same gain taxed at 15% costs only $15,000, saving you $22,000.

In addition to the basic capital gains tax, high-income taxpayers may be subject to the 3.8% Net Investment Income Tax (NIIT), which applies when your modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly. This additional tax effectively increases the maximum long-term capital gains rate to 23.8% and the maximum short-term rate to 40.8% for the highest earners.

Cost Basis Methods: FIFO, LIFO, and Specific Identification

When you sell a portion of your shares in a stock that you purchased at different times or prices, you must determine which shares were sold. The IRS allows several methods for making this determination, and your choice can significantly impact the amount of tax you owe. Understanding these methods and choosing the most advantageous one is an important part of tax-efficient investing.

FIFO

First In, First Out sells your oldest shares first. This is the default method for most brokerages and generally produces the lowest tax on gains because older shares are more likely to have been held long-term and likely have the largest gains. FIFO is simple and requires no additional action on your part.

LIFO

Last In, First Out sells your most recently purchased shares first. This method is not commonly used for stocks as it tends to produce short-term gains, but it can be beneficial if your most recent purchases had a higher cost basis, reducing your taxable gain. LIFO is less commonly supported by brokerages.

Specific ID

Specific identification allows you to choose exactly which shares to sell. This gives you the most control over your tax outcome, letting you sell high-basis shares to minimize gains or sell loss shares to offset gains elsewhere. You must identify the shares at the time of sale and your broker must support this method.

Most modern brokerages offer specific identification as an option when placing a sell order. If you want to minimize your tax liability, specific identification is generally the most powerful method because it gives you complete control. For example, if you bought 100 shares at $50 and 100 shares at $80, and the current price is $100, selling the $80 shares produces a $20 per share gain, while selling the $50 shares produces a $50 per share gain. Using specific identification to sell the higher-basis shares saves you $30 per share in taxable gains.

Stock Capital Gains Calculation Examples

Below are worked examples showing the estimated federal tax on different stock gain amounts for both short-term and long-term holding periods. Actual tax varies based on your total income and filing status.

$10,000 Stock Gain

Long-Term (held > 1 year)

At 0% rate: $0 tax

At 15% rate: $1,500 tax

At 20% rate: $2,000 tax

Short-Term (held ≤ 1 year)

At 22% rate: $2,200 tax

At 32% rate: $3,200 tax

At 37% rate: $3,700 tax

$50,000 Stock Gain

Long-Term (held > 1 year)

At 0% rate: $0 tax

At 15% rate: $7,500 tax

At 20% rate: $10,000 tax

Short-Term (held ≤ 1 year)

At 22% rate: $11,000 tax

At 32% rate: $16,000 tax

At 37% rate: $18,500 tax

$100,000 Stock Gain

Long-Term (held > 1 year)

At 0% rate: $0 tax

At 15% rate: $15,000 tax

At 20% rate: $20,000 tax

Short-Term (held ≤ 1 year)

At 22% rate: $22,000 tax

At 32% rate: $32,000 tax

At 37% rate: $37,000 tax

The Cost of Short-Term Holding: A $100,000 Example

Suppose you have a $100,000 stock gain and are in the 35% ordinary income bracket:

Short-term tax (35%): $35,000

Long-term tax (15%): $15,000

Potential savings by holding longer than 1 year: $20,000

This example illustrates why holding stocks for more than one year is one of the simplest and most effective tax reduction strategies available to investors.

Mutual Fund and ETF Capital Gains

Mutual funds and exchange-traded funds (ETFs) create unique capital gains situations that differ from individual stock investments. When a mutual fund manager sells securities within the fund at a profit, those gains must be distributed to shareholders at least annually. These capital gains distributions are taxable to you in the year they are received, regardless of whether you reinvest them or take them as cash. This means you can owe taxes on fund gains even if you have never sold any of your shares and the fund's share price has declined.

Capital gains distributions from mutual funds are reported on Form 1099-DIV and are typically classified as either short-term or long-term based on how long the fund held the underlying securities, not how long you have owned the fund. Short-term distributions are taxed at your ordinary income rate, while long-term distributions benefit from preferential rates. When evaluating mutual funds, it is worth considering the fund's historical capital gains distributions, as high-distribution funds can create unexpected tax bills for shareholders.

ETFs generally generate fewer capital gains distributions than actively managed mutual funds due to their unique creation and redemption mechanism. When ETF shares are redeemed, the fund typically distributes in-kind baskets of securities rather than selling securities for cash, which reduces the realization of capital gains within the fund. This structural advantage makes ETFs more tax-efficient than many mutual funds, particularly for taxable accounts.

When you sell your mutual fund or ETF shares, you also realize your own capital gain or loss. If you have been reinvesting distributions, your cost basis includes the reinvested amounts, which actually increases your basis and reduces your gain when you eventually sell. Your broker tracks your average cost basis for mutual fund shares unless you elect a different method. For ETFs, specific identification is usually available, giving you more control over the tax consequences of your sales.

Stock Split Adjustments and Cost Basis

Stock splits are corporate actions that increase the number of outstanding shares while proportionally decreasing the share price. They do not change your total investment value or your total cost basis, but they do require you to adjust your per-share cost basis for accurate tax reporting. The two most common types of splits are forward splits and reverse splits.

Forward Split Example (2-for-1)

Original: 100 shares at $100/share = $10,000 basis

After split: 200 shares at $50/share

New per-share basis: $10,000 / 200 = $50/share

Total basis unchanged: $10,000

Reverse Split Example (1-for-5)

Original: 500 shares at $5/share = $2,500 basis

After split: 100 shares at $25/share

New per-share basis: $2,500 / 100 = $25/share

Total basis unchanged: $2,500

Stock dividends (as opposed to cash dividends) also affect your cost basis. When a company issues a stock dividend, you receive additional shares without paying cash, but your total cost basis is now spread across more shares, reducing the per-share basis. Your broker should automatically adjust your cost basis for stock splits and stock dividends, but it is always wise to verify the adjustments on your statements. Keep all confirmations and statements to ensure accurate reporting when you eventually sell.

Employee Stock Options: ISOs and NSOs

Employee stock options are a form of compensation that gives employees the right to purchase company stock at a predetermined price (the exercise or strike price) within a specified period. There are two main types: Incentive Stock Options (ISOs) and Non-Qualified Stock Options (NSOs). Understanding the tax treatment of each type is critical because the difference in tax liability can be substantial, often tens of thousands of dollars on a single exercise.

Incentive Stock Options (ISOs)
  • No regular income tax at exercise
  • Spread may trigger AMT liability
  • Long-term gains if held 2 yrs from grant + 1 yr from exercise
  • Subject to $100,000 annual vesting limit
Non-Qualified Stock Options (NSOs)
  • Ordinary income tax on spread at exercise
  • Subject to payroll taxes (FICA/Medicare)
  • Future gains taxed as capital gains
  • No annual vesting limit

For NSOs, the difference between the exercise price and the fair market value at exercise is taxed as ordinary income (plus payroll taxes). For example, if you exercise NSOs with a strike price of $20 when the stock is trading at $80, you owe ordinary income tax on the $60 spread per share. When you later sell the shares, any additional appreciation beyond the $80 fair market value at exercise is taxed as a capital gain.

ISOs offer potentially better tax treatment if you meet the holding requirements: you must hold the shares for at least two years from the grant date and one year from the exercise date. If you satisfy both requirements, the entire gain qualifies for long-term capital gains rates. However, the bargain element (spread at exercise) may be subject to the Alternative Minimum Tax in the year of exercise, which can create a significant AMT liability even though no regular income tax is due at exercise. Many employees exercise ISOs strategically and plan for the AMT impact to maximize tax savings.

Day Trading Tax Implications

Day trading generates almost exclusively short-term capital gains because positions are opened and closed within the same trading day. This means all trading profits are taxed at your ordinary income rate, which can be as high as 37% plus the 3.8% NIIT. For active day traders, the cumulative tax burden can be enormous, potentially consuming a third or more of gross trading profits.

However, day traders may qualify for trader tax status (TTS), which provides several significant tax advantages. If the IRS classifies you as being in the trade or business of trading (rather than an investor), you can elect Mark-to-Market (Section 475) treatment. Under MTM, all your positions are treated as sold at year-end for tax purposes, and all gains and losses are treated as ordinary income. The key advantage is that MTM traders can deduct unlimited trading losses against ordinary income, without the $3,000 annual limitation that applies to investors.

Day traders who qualify for TTS can also deduct business expenses such as home office costs, computer equipment, internet, data feeds, and trading education. These deductions reduce ordinary income and can provide meaningful tax savings. Additionally, TTS traders may be eligible to set up a Solo 401(k) or SEP-IRA and contribute a significant portion of their trading income to a tax-advantaged retirement account. Qualifying for TTS requires meeting certain criteria regarding trading frequency, volume, and regularity, so consult a tax professional who specializes in trader taxation.

Stock Capital Gains Tax FAQ

How much tax do I pay on stock gains?

The tax you pay on stock gains depends on your holding period and income level. Short-term gains (held one year or less) are taxed at ordinary income rates of 10% to 37%. Long-term gains (held more than one year) are taxed at preferential rates of 0%, 15%, or 20% based on your taxable income. For example, a single filer with $80,000 in taxable income pays 0% on long-term gains up to $48,350 and 15% on gains above that. High earners with income above $200,000 may also owe the additional 3.8% Net Investment Income Tax.

What is the difference between FIFO and specific identification for stock sales?

FIFO (First In, First Out) sells your oldest shares first, which generally results in the largest long-term gains and the lowest tax rate. Specific identification allows you to choose which specific shares to sell, giving you control over your tax outcome. With specific identification, you can sell shares with the highest cost basis first to minimize gains, or sell shares with losses to offset gains elsewhere. Most brokerages now support specific identification, but you must designate the shares at the time of sale. FIFO is the default method if you do not specify.

How does a stock split affect my cost basis?

A stock split does not change your total investment value or total cost basis. Instead, it divides your existing shares into more shares at a proportionally lower price per share. For example, in a 2-for-1 split, you receive two shares for every one you own, and your per-share cost basis is cut in half. If you bought 100 shares at $50 each (total basis $5,000) and the stock splits 2-for-1, you would own 200 shares with a cost basis of $25 per share (total basis remains $5,000). Your total gain or loss when you sell remains the same regardless of the split.

How are mutual fund capital gains taxed?

Mutual funds generate taxable capital gains in two ways. First, when the fund manager sells securities within the fund at a profit, those gains are distributed to shareholders as capital gains distributions, typically annually. You owe tax on these distributions even if you reinvest them in additional shares. Second, when you sell your mutual fund shares, you realize your own capital gain or loss based on the difference between your sale proceeds and your cost basis. Fund distributions can be short-term or long-term depending on how long the fund held the underlying securities.

How are employee stock options (ISOs and NSOs) taxed?

Incentive Stock Options (ISOs) and Non-Qualified Stock Options (NSOs) have different tax treatments. With NSOs, you pay ordinary income tax on the spread between the exercise price and the fair market value at exercise. With ISOs, there is no regular income tax at exercise, but the spread may be subject to the Alternative Minimum Tax (AMT). For both types, when you eventually sell the shares, any additional gain beyond the exercise price is taxed as a capital gain. If you hold ISO shares for at least two years from the grant date and one year from the exercise date, the entire gain qualifies for long-term capital gains treatment.

Do I pay tax on stock gains in a retirement account?

Stock gains within a traditional IRA or 401(k) are tax-deferred, meaning you do not pay capital gains tax as the investments grow. Instead, withdrawals in retirement are taxed as ordinary income. In a Roth IRA or Roth 401(k), qualified withdrawals are completely tax-free. Stock gains in taxable brokerage accounts are subject to capital gains tax each year you realize gains. This is why tax-advantaged retirement accounts are excellent for actively traded investments that would generate short-term gains in a taxable account.

What is the wash sale rule and how does it affect my taxes?

The wash sale rule disallows a tax loss deduction if you sell a security at a loss and purchase a substantially identical security within 30 days before or after the sale. This includes buying the same stock, purchasing an option on the same stock, or buying shares in a mutual fund that tracks the same index. The disallowed loss is added to the cost basis of the replacement shares, which defers the loss deduction until you eventually sell the new shares. To avoid wash sale violations, wait at least 31 days before repurchasing a sold security.

How do I report stock capital gains on my tax return?

Your brokerage sends you Form 1099-B each year, which reports all your stock sales. You report each transaction on IRS Form 8949, including the date acquired, date sold, proceeds, cost basis, and gain or loss. The totals from Form 8949 flow to Schedule D, which summarizes your net capital gains and losses for the year. The net capital gain is then transferred to your Form 1040. Most tax software can import your 1099-B data directly from your broker, simplifying the reporting process significantly.

Can I deduct stock losses from my taxes?

Yes, stock losses can be used to offset stock gains dollar-for-dollar. If your total capital losses exceed your capital gains for the year, you can deduct up to $3,000 of the net loss ($1,500 if married filing separately) against your ordinary income. Any remaining unused losses carry forward to future tax years indefinitely. This makes tax-loss harvesting a valuable strategy where you intentionally sell losing investments to offset gains from winning investments, reducing your overall tax liability.

Calculate Your Stock Capital Gains Tax Now

Use our free online calculator to get an accurate estimate of your capital gains tax on stocks, mutual funds, and employee stock options. Updated with 2025-2026 tax rates.