TAX
Capital Gains Tax Calculator - Stock and Asset Sale Tax
By Worldtickers ·
Estimate your capital gains tax on stocks, real estate, or other assets. See the difference between short-term and long-term rates including state tax.
This capital gains tax tool focuses on estimate your capital gains tax on stocks, real estate, or other assets. See the difference between short-term and long-term rates including state tax. Use it to analyze property numbers such as cash flow, costs, returns, taxes, rent, and financing assumptions before buying, selling, refinancing, or comparing rental scenarios.
Calculator
Capital Gains Tax Calculator
Calculate tax on stock or asset sales.
What Is Capital Gains Tax?
Capital gains tax is the tax you pay on the profit from selling an asset such as stocks, bonds, real estate, cryptocurrency, or other investments. The tax is triggered only when you sell, not when the asset increases in value while you hold it. This is known as "unrealized gain" — you do not owe tax until you realize the gain by selling.
The rate at which capital gains are taxed depends on how long you held the asset. Short-term capital gains, on assets held for one year or less, are taxed at ordinary income tax rates ranging from 10% to 37%. Long-term capital gains, on assets held for more than one year, benefit from preferential rates of 0%, 15%, or 20% depending on your income. This distinction creates a significant incentive to hold investments for at least one year and one day.
In addition to federal tax, most states tax capital gains as ordinary income. Some states offer preferential treatment, while others have no income tax at all. High-income earners may also owe the 3.8% Net Investment Income Tax (NIIT) on investment gains. This calculator estimates your total capital gains tax at both federal and state levels.
How to Use This Calculator
Enter the purchase price (cost basis), sale price, holding period, and your filing status and income. The calculator determines whether your gain is short-term or long-term, applies the appropriate federal and state rates, and shows your total tax and effective capital gains rate.
Cost Basis and Sale Price
Cost basis is what you originally paid for the asset, including commissions and fees. Sale price is the amount you received after selling. The difference is your capital gain or loss. If you reinvested dividends, those shares have their own cost basis separate from your original purchase.
Holding Period
Enter the date you acquired the asset and the date you sold it. The holding period determines whether the gain is short-term (one year or less) or long-term (more than one year). The holding period starts the day after purchase and ends on the sale date. Missing the one-year threshold by even one day can result in significantly higher taxes.
Formula
Capital gain is calculated as: Capital Gain = Sale Price − Cost Basis. If the result is positive, you have a taxable gain. If negative, you have a capital loss.
For short-term gains: Tax = Gain × Marginal Income Tax Rate. The gain is added to your ordinary income and taxed at your bracket rate.
For long-term gains: Tax = Gain × Preferential Rate (0%, 15%, or 20%), plus potentially 3.8% NIIT. The preferential rate is determined by your total taxable income.
Examples
Example 1: Stock Held 8 Months (Short-Term)
You bought 100 shares at $50 each ($5,000 total) and sold after 8 months at $65 each ($6,500 total). Your short-term capital gain is $1,500. As a single filer in the 22% bracket, this gain is taxed at 22%, resulting in $330 in federal tax. If you also owe 5% state tax, the total is $405. Holding for just four more months would have qualified for the 15% long-term rate, saving approximately $105.
Example 2: Stock Held 3 Years (Long-Term)
You bought 100 shares at $50 each ($5,000) and sold after 3 years at $120 each ($12,000). Long-term capital gain is $7,000. As a single filer with $80,000 taxable income, you fall in the 15% long-term bracket. Federal tax is $7,000 × 15% = $1,050. Adding 5% state tax brings the total to $1,400. The preferential rate saved you $525 compared to the 22% short-term rate.
Example 3: Real Estate, $200,000 Gain
You sell a rental property with a $200,000 gain (held 5 years). Assuming $100,000 taxable income, the long-term rate is 15%, so federal tax is $30,000. Adding state tax at 6% ($12,000) and NIIT at 3.8% ($7,600, if applicable) brings the total to approximately $49,600. The primary residence exclusion does not apply to rental properties, but a 1031 exchange could defer this tax entirely if you reinvest in a qualifying property.
Tips
Hold for More Than One Year
The single most impactful tax strategy for investors is holding assets for more than one year. Short-term gains are taxed at up to 37%, while long-term gains top out at 20% (plus 3.8% NIIT). For a $50,000 gain, this difference can save $5,000 to $10,000 or more. If you are considering selling appreciated assets, check whether you are close to the one-year threshold.
Harvest Losses to Offset Gains
Tax-loss harvesting involves selling investments at a loss to offset gains. Short-term losses offset short-term gains first, then long-term. If losses exceed gains, up to $3,000 per year can be deducted against ordinary income, with excess losses carrying forward. Many investors harvest losses quarterly or year-end to reduce their capital gains tax burden.
Use Tax-Advantaged Accounts
Investments held in 401(k), traditional IRA, or Roth IRA accounts do not generate capital gains tax while in the account. Traditional accounts defer the tax; Roth accounts eliminate it entirely for qualified distributions. Maximize contributions to these accounts before using taxable brokerage accounts for long-term holdings.
Be Mindful of Year-End Timing
If you have both gains and losses, consider the timing of your sales. Selling a loss position before year-end can offset gains realized earlier in the year. However, be aware of the wash-sale rule, which disallows a loss deduction if you repurchase the same or substantially identical security within 30 days before or after the sale.
FAQ
What is the difference between short-term and long-term capital gains?
Short-term capital gains apply to assets held for one year or less and are taxed at ordinary income tax rates (10% to 37%). Long-term capital gains apply to assets held for more than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your income. The holding period starts the day after you purchase the asset and ends on the day you sell it.
What are the long-term capital gains tax rates for 2026?
For 2026, the long-term capital gains rates are 0% for taxable income up to approximately $48,350 (single) or $96,700 (married filing jointly), 15% for income up to approximately $533,400 (single) or $600,050 (married filing jointly), and 20% above those thresholds. An additional 3.8% Net Investment Income Tax (NIIT) may apply to high earners with modified AGI above $200,000 (single) or $250,000 (married filing jointly).
How do I calculate my capital gain or loss?
Capital gain or loss is the difference between your sale price and your cost basis. Cost basis is generally what you paid for the asset plus any commissions or fees. If you bought stock at $10,000 and sold it for $15,000, your capital gain is $5,000. If you sold for $8,000, your capital loss is $2,000. Capital losses can offset capital gains, and up to $3,000 in net losses can be deducted against ordinary income per year.
Does state tax apply to capital gains?
Most states tax capital gains as ordinary income. The rate varies by state, from 0% in states with no income tax (Texas, Florida, Washington, Nevada, etc.) to over 13% in California. A few states offer preferential rates for long-term gains. The calculator allows you to include your state tax rate for a complete estimate of your total capital gains tax burden.
What is the 3.8% Net Investment Income Tax?
The NIIT is an additional 3.8% surtax on investment income (including capital gains, dividends, interest, and rental income) for high-income taxpayers. It applies when modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately). The tax is on the lesser of net investment income or the amount by which MAGI exceeds the threshold.
Can I offset capital gains with capital losses?
Yes. Capital losses first offset capital gains of the same type (short-term losses offset short-term gains, long-term losses offset long-term gains). If losses exceed gains, up to $3,000 per year can be deducted against ordinary income ($1,500 if married filing separately). Unused losses carry forward to future years indefinitely. This is the basis of tax-loss harvesting strategies.
How do I reduce capital gains tax?
Strategies include holding assets for more than one year to qualify for lower long-term rates, tax-loss harvesting to offset gains, investing in tax-advantaged accounts (401(k), IRA, Roth IRA) where gains are deferred or tax-free, donating appreciated assets to charity to avoid the gain entirely, and timing sales to manage your income bracket. For real estate, a primary residence exclusion allows up to $250,000 ($500,000 married) in gains to be excluded.
What is the cost basis of inherited assets?
Inherited assets receive a stepped-up cost basis equal to the fair market value on the date of the decedent's death (or the alternate valuation date). This means if your parent bought stock for $10,000 and it was worth $50,000 when they died, your cost basis is $50,000. If you sell immediately, there is no taxable gain. This stepped-up basis is one of the most powerful tax benefits in the tax code.