Audited ·Last updated 27 Jul 2026·5 citations·Tier 2·0 uses

Long-Term Capital Gains Tax Calculator

Calculate long-term capital gains tax at 0%, 15%, or 20% federal rates. See federal and state tax on assets held over one year. Free tool.

Long-Term Capital Gains Tax Calculator

Original cost basis
$
Sale proceeds
$
Other taxable income
$
Filing Status
State capital gains or income tax rate
%
Capital Gain
$80,000.00
Sale price minus purchase price
Federal Tax
$12,000.00
State Tax
$0.00
Total Tax
$12,000.00
Net Proceeds
$168,000.00
Federal Tax Rate
15.00%
Effective Tax Rate
15.00%

Background.

Long-term capital gains are profits from selling assets held for more than one year, and they receive preferential tax treatment compared to ordinary income and short-term gains. The federal rates are 0%, 15%, or 20%, depending on the taxpayer's total taxable income. For 2024, single filers with taxable income below $47,025 pay 0% on long-term gains. Those between $47,026 and $518,900 pay 15%, and those above $518,900 pay 20%. These thresholds are roughly doubled for married couples filing jointly. An additional 3.8% Net Investment Income Tax applies to high-income taxpayers, bringing the top effective federal rate to 23.8%.

The 0% rate is one of the most underutilized tax strategies. Retirees with modest taxable income, young investors with low earnings, and anyone in a low-income year can realize substantial gains without paying federal tax. For example, a retiree with $30,000 in taxable income can realize $17,000 in long-term gains completely tax-free at the federal level. This is particularly valuable for tax-loss harvesting, rebalancing, and stepping up basis in appreciated assets. Financial advisors often recommend tax-gain harvesting for clients in the 0% bracket, which involves realizing gains and immediately repurchasing the same security to establish a higher cost basis for future sales.

The bracket stacking works by adding the gain on top of other income. A taxpayer with $40,000 in income who realizes a $20,000 long-term gain pays 0% on the first $7,025 of the gain (which brings total income to $47,025) and 15% on the remaining $12,975. The effective rate is 9.75%, not 15%. This tiered structure means that even taxpayers in the 15% bracket may pay less than 15% on their entire gain. Understanding these mechanics allows investors to time sales strategically, potentially saving thousands in taxes. This calculator models the full bracket stacking for accurate tax estimation. The long-term preference has been a feature of the tax code since 1921, though the rates and brackets have changed repeatedly through legislative action.

Long-term gains also feature prominently in estate planning. Assets held until death receive a stepped-up basis, eliminating built-in gain for heirs. This interaction between the long-term preference and the estate tax makes holding periods a central consideration for wealthy families. Congress has debated limiting or eliminating the stepped-up basis, but the provision remains in effect as of 2024.

The long-term capital gains preference faces periodic legislative risk. Proposals to tax gains as ordinary income or to impose mark-to-market taxation on wealthy taxpayers appear regularly in federal budget discussions. While none have been enacted as of 2024, investors with large unrealized gains should monitor legislative developments and consider acceleration strategies if rates appear likely to rise.

Qualified Small Business Stock (QSBS) under Section 1202 provides an even more favorable exclusion of up to 100% of gain for investments in certain C-corporations held for more than five years. This exclusion is capped at the greater of $10 million or ten times the basis, making it one of the most powerful tax incentives for startup investors.

Understanding these rules is essential for comprehensive wealth management.

What is long-term capital gains tax calculator?

Long-term capital gains are profits from selling assets held for more than one year. They are taxed at preferential federal rates of 0%, 15%, or 20% based on the taxpayer's total taxable income. These rates are significantly lower than ordinary income rates, which top out at 37%. The preferential treatment is designed to encourage long-term investment and reduce the tax burden on capital formation.

The statutory authority is found in Internal Revenue Code Section 1(h), which prescribes the alternative tax rate for net capital gain. A capital asset must be held for more than one year to qualify; the holding period is measured from the day after acquisition to the date of sale. The unit of taxation is the dollar of gain, but the rate schedule is independent of the ordinary income brackets. Taxpayers report long-term gains on Schedule D and calculate the tax on the Qualified Dividends and Capital Gain Tax Worksheet. The distinction between long-term and short-term is one of the most consequential classifications in individual taxation, affecting billions of dollars in annual tax liability.

Taxpayers complete the Qualified Dividends and Capital Gain Tax Worksheet to compute the tax.

Collectibles, such as art and precious metals, are taxed at a maximum rate of 28% regardless of holding period.

How to use this calculator.

  1. Enter the purchase price of the asset.
  2. Input the sale price.
  3. Enter your other taxable income for the year.
  4. Select your filing status.
  5. Optionally add your state's capital gains tax rate.
  6. Review the capital gain, federal tax bracket, and total tax.
  7. Compare with short-term rates to quantify the benefit of holding longer.

The formula.

FedTax = g₀×0% + g₁₅×15% + g₂₀×20%

The long-term capital gains tax calculation uses a tiered bracket system that is stacked on top of the taxpayer's other taxable income. Unlike ordinary income brackets, there are only three long-term brackets: 0%, 15%, and 20%. The thresholds for these brackets are separate from the ordinary income brackets and are indexed annually for inflation.

The stacking method works as follows: the taxpayer's other taxable income determines the starting point within the long-term brackets. If a single filer has $40,000 in other income, the first $7,025 of any long-term gain falls in the 0% bracket, and any gain above that falls in the 15% bracket. If the same filer had $60,000 in other income, the entire gain would fall in the 15% bracket because the starting point is already above the 0% threshold.

The 20% bracket applies only to the portion of total income (other income plus gain) that exceeds $518,900 for single filers. A taxpayer with $500,000 in other income who realizes a $50,000 gain pays 20% on the entire gain because the starting point is already in the 20% bracket. A taxpayer with $450,000 in other income pays 15% on the first $68,900 of gain and 20% on the remainder. This tiered structure makes the effective rate a weighted average of the marginal rates. State taxes, if applicable, are typically flat percentages of the total gain, though some states mirror the federal tiered system.

Mathematically, let I be other taxable income, G be the long-term gain, and T0, T1 be the bracket thresholds. The 0% portion is max(0, min(G, T0 minus I)). The 15% portion is max(0, min(G minus max(0, T0 minus I), T1 minus max(I, T0))). The 20% portion is G minus the sum of the first two portions. Federal tax equals 0.15 times the 15% portion plus 0.20 times the 20% portion. The effective federal rate is federal tax divided by G. This piecewise function is continuous and monotonic in G.

The effective federal rate provides a single summary metric for comparison.

This rate structure creates powerful incentives for patient capital allocation.

This mechanism ensures that long-term capital receives favorable treatment under the tax code.

Taxpayers should model multi-year scenarios carefully.

A worked example.

Example

An investor buys stock for $100,000 and sells it after 18 months for $140,000, producing a $40,000 long-term capital gain. The investor's other taxable income is $42,000. For 2024, the 0% long-term bracket for single filers ends at $47,025. The first $5,025 of the gain falls in the 0% bracket, bringing total income to $47,025. The remaining $34,975 falls in the 15% bracket, producing federal tax of $5,246.25. The effective federal rate on the entire gain is 13.1%, not 15%. If the investor had $60,000 in other income, the entire gain would be in the 15% bracket, producing $6,000 in tax. The $18,000 difference in other income produces a $1,753.75 difference in capital gains tax, demonstrating how income timing affects tax liability. This example shows why investors in variable-income professions should coordinate gain realization with low-income years, and why retirees often realize gains before required minimum distributions begin. Careful timing can produce significant tax savings.

filing Statussingle
state Tax Rate0
sale Price140,000
taxable Income42,000
purchase Price100,000

Frequently asked questions.

What is the holding period for long-term capital gains?
More than one year. The period begins the day after purchase and ends on the sale date. Holding for 366 days qualifies as long-term. Selling on the 365th day is short-term. Verify holding periods carefully, especially around leap years and weekends, because settlement dates can shift the acquisition date. For securities purchased in multiple lots, specific identification allows the taxpayer to choose which shares are sold. If no method is specified, brokers default to FIFO (first in, first out), which may not be optimal for tax purposes. The holding period for restricted stock begins when the restrictions lapse, not when the shares are originally granted.
How does the 0% rate work?
If your total taxable income, including the gain, falls within the 0% bracket, you pay no federal tax on that portion of the gain. For 2024, single filers can have up to $47,025 in total taxable income at the 0% rate. This means a single filer with no other income can realize up to $47,025 in long-term gains tax-free. Married couples filing jointly can realize up to $94,050 tax-free. The 0% bracket is particularly valuable for retirees with modest pension income, young investors with low wages, and anyone experiencing a temporary income reduction. Tax-gain harvesting in the 0% bracket allows investors to step up basis without triggering federal tax, reducing future liability.
Can I have 0% federal tax but still owe state tax?
Yes. Many states tax capital gains as ordinary income with no preferential long-term rate. California, for example, taxes capital gains at up to 13.3% regardless of holding period. Even if your federal rate is 0%, you may owe state tax. New York and New Jersey also tax gains as ordinary income. By contrast, states with no income tax, such as Texas, Florida, and Nevada, impose no state capital gains tax. Washington state has no income tax but imposes a 7% capital gains tax on gains above $250,000 annually. Investors should model both federal and state liability before realizing large gains.
What is the Net Investment Income Tax?
The NIIT is a 3.8% tax on investment income, including long-term capital gains, for taxpayers with modified adjusted gross income above $200,000 (single) or $250,000 (married). It applies on top of the 15% or 20% rate, meaning the top effective federal rate on long-term gains is 23.8%. The tax was introduced by the Affordable Care Act in 2013. It is reported on Form 8960. Taxpayers can sometimes avoid the surtax by reducing MAGI through retirement contributions, health savings account contributions, or charitable donations. The NIIT threshold is not indexed to inflation, so an increasing share of taxpayers becomes subject to it each year.
Do long-term gains affect my Medicare premiums?
Yes. Capital gains increase your modified adjusted gross income (MAGI), which determines Medicare Part B and Part D premiums for retirees through income-related monthly adjustment amounts (IRMAA). A large gain can push you into a higher IRMAA bracket, increasing premiums by thousands per year. The IRMAA brackets are cliff thresholds, meaning one dollar of extra MAGI can trigger a higher premium tier. Retirees should consider the two-year lookback period for IRMAA calculations, which uses MAGI from two years prior. Timing gain realizations to avoid IRMAA cliffs is a common tax planning strategy for Medicare beneficiaries.
Can I offset long-term gains with short-term losses?
Yes. Capital losses offset capital gains regardless of holding period. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Any remaining losses cross over to offset the other type. Net losses up to $3,000 can offset ordinary income, with excess carried forward. This netting hierarchy means that long-term losses used against short-term gains produce greater tax savings than long-term losses against long-term gains, because short-term gains are taxed at higher rates. Taxpayers should plan loss harvesting strategically, especially near year-end, to maximize the value of the offset.
How do qualified dividends relate to long-term gains?
Qualified dividends are taxed at the same preferential rates as long-term capital gains: 0%, 15%, or 20%. They use the same bracket thresholds and stacking method. However, dividends are income when received, while gains are income when realized. Both count toward the NIIT threshold. The holding period for qualified dividends requires holding the stock for more than 60 days during the 121-day period beginning 60 days before the ex-dividend date. Preferred stock requires a 90-day holding period. The parallel treatment of qualified dividends and long-term gains creates symmetry in the taxation of equity returns.
Should I realize gains in a low-income year?
Yes, if possible. Realizing long-term gains in years with low taxable income allows more of the gain to fall in the 0% bracket. This is a common strategy for retirees, those between jobs, or anyone with a temporary income reduction. Tax-gain harvesting involves realizing gains at 0% and immediately repurchasing the same security to step up basis, which is permissible because wash sale rules apply only to losses. The stepped-up basis reduces future gain without triggering current tax. This strategy should be coordinated with other income sources, such as Roth conversions, to avoid pushing total income above the 0% threshold.

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon