Stock Capital Gains Tax Calculator 2026
Calculate your capital gains tax on stock sales instantly. Estimate taxes on short-term and long-term stock gains, employee stock options, and dividend income with accurate 2025-2026 federal rates.
Purchase Information
Sale Information
Tax Filing Information
Your income from other sources (excluding this gain)
How Are Stocks Taxed?
>1 Year
Long-term: 0%, 15%, or 20% rates
≤1 Year
Short-term: 10% to 37% rates
+3.8%
NIIT for high-income earners
The Core Tax Rule for Stocks
When you sell stocks for a profit in the United States, the IRS considers that profit to be a capital gain, and it is subject to federal income tax. The tax treatment of your stock gains depends primarily on how long you held the shares before selling them.
This holding period distinction is the single most important factor in determining your tax liability on stock transactions, and understanding it can save you thousands of dollars each year.
Long-Term vs Short-Term Rates
Stocks held for more than one year qualify for long-term capital gains treatment, which features preferential tax rates of 0%, 15%, or 20%, depending on your total taxable income and filing status. Stocks held for one year or less generate short-term capital gains, which are taxed at your ordinary income tax rate, which can be as high as 37% for the highest earners.
Understanding Cost Basis
Your cost basis is generally the purchase price per share multiplied by the number of shares, plus any commissions or fees paid at the time of purchase. If you acquired shares at different times and prices, the IRS requires you to use a specific method to identify which shares were sold.
Choosing a Share Identification Method
The default method for identifying shares is FIFO (First In, First Out), but you can also use specific identification or the average cost method for mutual fund shares. Choosing the right method can have a significant impact on your tax liability, especially if you have shares purchased at vastly different prices over time.
Dividend Tax Implications
In addition to capital gains on stock sales, investors must also consider the tax implications of dividends. Qualified dividends, which come from shares held for a minimum period and paid by qualified corporations, are taxed at the same preferential rates as long-term capital gains—0%, 15%, or 20%. Non-qualified dividends, also known as ordinary dividends, are taxed at your ordinary income rate.
The distinction between qualified and non-qualified dividends depends on both the type of corporation paying the dividend and the holding period of the stock. Understanding this distinction is important for tax planning, as the rate difference can be substantial.
High-Income? Watch for the NIIT
High-income taxpayers must also account for the 3.8% Net Investment Income Tax (NIIT), which applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds certain thresholds. For 2026, the NIIT thresholds are $200,000 for single filers, $250,000 for married filing jointly, $125,000 for married filing separately, and $200,000 for head of household.
State Capital Gains Taxes
This additional tax can push the effective top rate on long-term stock gains to 23.8% and short-term gains to as much as 40.8% for high earners.
It is also important to consider state capital gains taxes, which apply in addition to federal taxes. Most states tax capital gains as ordinary income, with rates varying from 0% in states like Florida, Texas, and Nevada, to over 13% in California. The combined federal and state tax burden on stock gains can be significant, making tax-efficient investment strategies all the more important. Visit our capital gains tax calculator for a complete estimate that factors in both federal rates and the NIIT.
Short-Term vs Long-Term Stock Gains
Short-Term Stock Gains
- • Held for 1 year or less before selling
- • Taxed at ordinary income rates (10%–37%)
- • No preferential tax treatment
- • Common for day traders and active investors
- • Higher tax burden erodes investment returns
Long-Term Stock Gains
- • Held for more than 1 year before selling
- • Taxed at preferential rates (0%, 15%, 20%)
- • Significant tax savings potential
- • Encourages buy-and-hold investing strategy
- • Additional 3.8% NIIT for high earners
Real Savings Example
Short-Term Gain ($100K)
~$32,000
in federal tax at 32% bracket
Long-Term Gain ($100K)
~$15,000
in federal tax at 15% bracket
💰 Holding just a few extra days saves $17,000 in this scenario!
Understanding the Holding Period
The distinction between short-term and long-term stock gains can mean the difference between paying 37% and 0% on your investment profits, making it one of the most impactful factors in your overall tax strategy. The IRS defines the holding period as beginning the day after you acquire the stock and ending on the day you sell it.
This means that if you purchase shares on January 1st and sell them on January 1st of the following year, your holding period is only 364 days—still short-term. You must hold the shares through January 2nd to achieve a holding period of 365 days and qualify for long-term capital gains treatment.
A Practical Example
Consider an investor in the 32% ordinary income tax bracket who realizes a $100,000 gain on a stock position. If the gain is short-term, the federal tax would be approximately $32,000. If the same gain qualifies as long-term and falls within the 15% capital gains bracket, the tax drops to just $15,000—a savings of $17,000 simply by holding the shares a few extra days beyond the one-year mark.
For investors with larger positions, the savings can be even more dramatic, especially when you factor in the compounding effect of reinvested tax savings over multiple years.
Timing Strategy: The 0% Opportunity
In years when your income is lower—such as during a sabbatical, early retirement, or between jobs—you may be able to realize long-term gains at the 0% rate, effectively paying no federal tax on those gains. Always check your income before selling.
Plan Before You Sell
This tax differential makes careful timing of stock sales one of the most effective tax planning strategies available to investors. Before selling any appreciated stock, always check whether you are close to the one-year holding threshold.
If you are only a few days away, waiting to sell can result in substantial tax savings. Additionally, investors should consider their overall income picture for the year, as the long-term capital gains brackets are based on total taxable income. Learn more about optimizing your tax strategy on our short-term capital gains and long-term capital gains pages.
Employee Stock Options Tax
ISOs
Most tax-favorable. No regular tax at exercise. Long-term gains if held 1yr+ from exercise & 2yr+ from grant.
NSOs
Bargain element taxed as ordinary income at exercise. Reported on W-2. Simpler but less tax-efficient.
RSUs
Taxed as ordinary income at vesting based on FMV. Employer withholds tax. Simplest form of equity comp.
Why Equity Compensation Matters
Employee stock compensation is a significant part of total compensation for many technology and startup workers, but the tax rules governing these benefits are complex and vary depending on the type of equity award. Understanding how your specific stock compensation is taxed is essential for avoiding surprise tax bills and making informed decisions about when to exercise options and sell shares.
There are three primary types of equity compensation: Incentive Stock Options (ISOs), Non-Qualified Stock Options (NSOs), and Restricted Stock Units (RSUs).
Incentive Stock Options (ISOs)
Incentive Stock Options (ISOs) offer the most favorable tax treatment but come with strict holding requirements. When you exercise ISOs, there is no regular income tax on the bargain element (the difference between the exercise price and the fair market value at exercise), but this amount may trigger the Alternative Minimum Tax (AMT).
If you hold the shares for at least one year from the exercise date and two years from the grant date, the entire gain—from exercise price to final sale price—is taxed as a long-term capital gain at the preferential rates of 0%, 15%, or 20%. This can result in enormous tax savings compared to NSOs, but failing to meet the holding requirements converts the bargain element into ordinary income.
Non-Qualified Stock Options (NSOs)
Non-Qualified Stock Options (NSOs) are more straightforward but less tax-efficient. When you exercise NSOs, the bargain element is immediately taxed as ordinary income and is reported on your W-2. Your employer also withholds taxes at the time of exercise.
Any appreciation in the stock price after exercise is taxed as a capital gain—short-term if you sell within one year, or long-term if you hold for more than one year. Unlike ISOs, NSOs do not have a minimum holding period requirement for tax purposes, but holding the shares after exercise still determines whether subsequent gains are taxed at ordinary or capital gains rates.
Restricted Stock Units (RSUs)
Restricted Stock Units (RSUs) are the simplest form of equity compensation for tax purposes. RSUs are taxed as ordinary income when they vest, based on the fair market value of the shares on the vesting date. Your employer withholds taxes at vesting, typically by selling a portion of the shares to cover the tax obligation.
After vesting, any future appreciation or depreciation is treated as a capital gain or loss when you eventually sell the shares. Because RSUs are taxed at vesting regardless of whether you sell the shares, many financial advisors recommend selling vested RSUs immediately to diversify and avoid concentrating too much wealth in a single stock.
Dividend Tax vs Capital Gains
Qualified Dividends
- Taxed at 0%, 15%, or 20%
- Must hold stock >60 days in 121-day period
- Paid by U.S. or qualified foreign corp
- Same rates as long-term capital gains
Non-Qualified Dividends
- Taxed at ordinary income rates (up to 37%)
- REITs, MLPs, money market funds
- Certain foreign corporations
- No preferential tax treatment
Dividends vs Capital Gains: Two Different Taxes
Investors often confuse dividend taxes with capital gains taxes, but they are fundamentally different types of investment income with distinct tax rules. Dividends are periodic payments made by a corporation to its shareholders out of its earnings and profits, while capital gains arise from the sale of an asset at a price higher than its purchase price.
Both types of income are reported on your tax return, but they are calculated and reported differently, and the tax rates that apply depend on specific classification criteria. Qualified dividends receive the same preferential tax treatment as long-term capital gains, with rates of 0%, 15%, or 20% depending on your taxable income and filing status.
Qualified Dividend Requirements
To qualify, the dividend must be paid by a U.S. corporation or a qualified foreign corporation, and you must hold the stock for more than 60 days during the 121-day period that begins 60 days before the ex-dividend date. This holding period requirement ensures that investors cannot simply buy a stock right before a dividend payment and immediately sell it to capture the preferential tax rate.
Non-Qualified Dividends: Higher Tax Burden
Non-qualified dividends, also called ordinary dividends, do not meet the criteria for qualified dividend treatment and are taxed at your ordinary income tax rate, which can be as high as 37%. Common sources include dividends from real estate investment trusts (REITs), master limited partnerships (MLPs), money market funds, and certain foreign corporations. Dividends from ESOPs and tax-exempt organizations are also typically non-qualified.
Key Difference: Control Over Timing
You have control over when you realize a capital gain by choosing when to sell, whereas dividends are received automatically based on the company's dividend schedule. This makes capital gains more amenable to tax planning strategies such as timing sales for lower-income years or using tax-loss harvesting to offset gains with losses.
NIIT Applies to Both Types
Both types of investment income may be subject to the 3.8% NIIT for high-income taxpayers, which can push the effective top rate on qualified dividends and long-term capital gains to 23.8%. For strategies on offsetting gains, visit our tax-loss harvesting guide.
Wash Sale Rule Explained
The 61-Day Wash Sale Window
30 Days Before
Sale Date
30 Days After
No repurchasing substantially identical securities within this entire 61-day window
What Is the Wash Sale Rule?
The wash sale rule, enacted under IRS Section 1091, prevents investors from claiming a tax loss on the sale of a security if they purchase the same or a substantially identical security within a 30-day period before or after the sale. The purpose is to prevent investors from creating artificial tax losses while maintaining essentially the same investment position.
The 61-Day Restricted Window
The 30-day window applies both before and after the loss sale, creating a total 61-day restricted period. For example, if you sell shares of Apple stock at a loss on March 15th, you cannot deduct that loss if you purchased substantially identical Apple shares between February 13th and April 14th.
The rule applies to purchases made in any of your accounts, including taxable brokerage accounts, IRA accounts, and even accounts owned by your spouse. Investors must coordinate their trading activity across all accounts to avoid unintended wash sale violations.
What Happens When a Wash Sale Occurs?
The disallowed loss is not permanently lost—it is added to the cost basis of the replacement shares. This adjustment effectively defers the tax benefit of the loss until you sell the replacement shares in a transaction that is not a wash sale. The holding period of the original shares is also added to the replacement shares.
What Counts as “Substantially Identical”?
For example, if you sell 100 shares of XYZ stock at a $5,000 loss and repurchase the same shares within 30 days, the $5,000 loss is disallowed but is added to the cost basis of the new shares. When you eventually sell the replacement shares, the higher cost basis will result in a smaller gain or larger loss, preserving the tax benefit.
The IRS has not precisely defined “substantially identical securities,” but securities that track the same index or represent the same company are considered substantially identical. Selling shares of an S&P 500 index fund and buying a different S&P 500 index fund would likely trigger the wash sale rule, whereas selling an S&P 500 fund and buying a total market index fund would generally not. Selling Apple stock and buying Apple call options would also trigger the rule.
Strategies to Avoid Wash Sale Violations
- Wait 31 days — Simply wait at least 31 days before repurchasing the same security
- Buy similar, not identical — Sell a tech ETF, buy a different tech ETF from another provider
- Double up — Purchase additional shares, wait 31 days, then sell the original shares at a loss
Tax-Loss Harvesting With Wash Sale Awareness
To avoid wash sale violations while still implementing tax-loss harvesting strategies, investors have several options. The simplest approach is to wait at least 31 days before repurchasing the same security. Alternatively, you can immediately purchase a similar but not substantially identical security to maintain market exposure—for example, selling a technology sector ETF and buying a different technology ETF, or selling one total market fund and buying another that tracks a different index.
You can also double up on your position by purchasing additional shares, waiting 31 days, and then selling the original shares at a loss. Each of these strategies has its own considerations, and investors should consult with a tax professional to determine the best approach for their specific situation.
Explore More Tax Calculators
TaxGainsCalc offers specialized calculators for different asset types and tax strategies. Check out these related tools to optimize your tax planning.
General Calculator
Calculate capital gains tax on any asset type with our comprehensive general-purpose calculator.
Try CalculatorCrypto Tax Calculator
Calculate capital gains tax on Bitcoin, Ethereum, and other cryptocurrency transactions.
Crypto CalculatorTax Loss Harvesting
Learn how to offset capital gains with strategic losses and reduce your overall tax burden.
Harvesting Guide