资本利得税计算器

计算投资收益的联邦资本利得税。输入买入和卖出价格,选择申报状态和持有期,即时查看预估税额、有效税率和税后收益,并进行短期与长期税率对比。

Calculate Capital Gains Tax

Enter your investment details to estimate federal capital gains tax for 2025.

What you paid for the asset (cost basis)

$

What you sold (or plan to sell) the asset for

$

Your other taxable income (excluding this gain) — determines which bracket applies

$

Losses from other investments to offset this gain

$

常见问题 About Capital Gains Tax

什么是资本利得税?

资本利得税是对出售股票、债券、房地产或其他投资等资本资产所获利润征收的税。税收基于销售价格与原始购买价格(成本基础)之差计算。只有当你以盈利方式出售资产时,资本利得才实现并需纳税。持有资产而不出售时,价值增加被视为未实现利得,不需纳税。税率取决于持有期限和应税收入水平。

短期资本利得和长期资本利得有什么区别?

关键区别在于持有期限。短期资本利得适用于持有一年或更短时间后出售的资产,以普通所得税税率(10%-37%,取决于收入档次)征税。长期资本利得适用于持有超过一年的资产,享有优惠税率 0%、15% 或 20%,具体取决于应税收入和报税状态。这一显著的税收优势是财务顾问建议在出售前持有投资至少一年的主要原因。

2025 年长期资本利得税率是多少?

2025 年,长期资本利得适用三档税率:0% 适用于应税收入不超过 $48,350 的单身申报人(已婚联合申报不超过 $96,700);15% 适用于收入在 $48,350 至 $533,400 之间的单身申报人(已婚联合申报 $96,700 至 $600,050);20% 适用于收入超过 $533,400 的单身申报人(已婚联合申报超过 $600,050)。此外,修正调整后总收入超过 $200,000(单身申报人)或 $250,000(已婚联合申报人)的高收入纳税人可能还需缴纳 3.8% 的净投资所得税(NIIT)。

如何计算资本利得?

计算资本利得时,将成本基础(购买价格加上相关费用如佣金)从销售价格中扣除。例如,若你以 $10,000 买入股票并以 $15,000 出售,资本利得为 $5,000。可以通过从其他投资中扣除资本损失来减少资本利得。如果总资本损失超过资本利得,可每年从普通收入中扣除最多 $3,000 的超额损失,剩余损失可结转至未来年度。

资本利得税有哪些豁免?

是的,存在多种豁免。最重要的是主要住所排除:如果你在过去 5 年中拥有并居住在自己的住宅至少 2 年,可以从出售中排除最多 $250,000 的资本利得(已婚联合申报为 $500,000)。持有在 401(k)、IRA 和 Roth IRA 等税收优惠账户中的资产免税或延税增长,这些账户内的资本利得不立即征税。继承资产以死亡日期的公平市场价值获得递增成本基础,可能消除被继承人生前增值的资本利得税。

报税状态如何影响资本利得税?

报税状态对资本利得税影响显著,因为它决定了每个税档的收入门槛。例如,0% 长期资本利得税率适用于单身申报人应税收入不超过 $48,350,但已婚联合申报可达 $96,700,有效翻倍了免税门槛。同样,NIIT 门槛对单身申报人和家庭户主为 $200,000,已婚联合申报为 $250,000,已婚分开申报仅为 $125,000。选择正确的报税状态可为投资收益节省数千美元的税款。

资本损失能抵消资本利得吗?

可以,资本损失可按美元对美元抵消资本利得。首先,短期损失抵消短期利得,长期损失抵消长期利得。任何剩余净损失可抵消另一类型的利得。如果当年总资本损失超过总资本利得,可从普通收入中扣除最多 $3,000 的净资本损失(已婚分开申报为 $1,500)。超过 $3,000 的损失可无限期结转至未来年度。这种策略称为税务损失收割,常用于最小化税务负担。

还需要缴纳州资本利得税吗?

大多数州将资本利得作为普通收入征税,因此除联邦资本利得税外,你可能还需缴纳州税。州税率差异很大:九个州没有所得税(阿拉斯加、佛罗里达、内华达、新罕布什尔、南达科他、田纳西、德克萨斯、华盛顿和怀俄明),而加利福尼亚州的资本利得税率可高达 13.3%。少数州对长期利得提供优惠税率或豁免某些类型的利得。该计算器仅估算联邦税;请咨询你所在州的税收指南或税务专业人员以了解总体合并税务负担。

Understanding Capital Gains Tax on Investments

What is Capital Gains Tax?

Capital gains tax is a federal tax levied on the profit realized from the sale of a capital asset. Capital assets include stocks, bonds, mutual funds, exchange-traded funds (ETFs), real estate, precious metals, cryptocurrency, collectibles, and other investments. The tax applies to the difference between what you paid for an asset (your cost basis) and what you received when you sold it.

A capital gain is only "realized" when you actually sell or dispose of an asset. As long as you continue to hold an investment, any increase in its value is considered an "unrealized gain" and is not subject to tax. This distinction is important because it gives investors control over when they recognize taxable gains, forming the basis for many tax planning strategies.

The United States tax code distinguishes between two types of capital gains based on how long you held the asset before selling: short-term and long-term. This holding period determines which tax rates apply and can result in dramatically different tax outcomes. Understanding this distinction is one of the most impactful tax planning decisions an investor can make, potentially saving thousands of dollars annually.

Capital gains tax is separate from ordinary income tax, though short-term gains are taxed at ordinary income rates. The tax applies at the federal level, and most states also impose their own capital gains taxes. This calculator focuses on federal capital gains tax, which is typically the largest component of the total tax liability on investment profits. For a broader view of how your overall income is taxed, see our Salary Calculator, which covers federal income tax brackets in detail.

Short-Term vs Long-Term Capital Gains

The holding period of an asset determines whether a capital gain is classified as short-term or long-term, which in turn determines the applicable tax rate. This is one of the most consequential distinctions in the U.S. tax code for investors.

Short-Term Capital Gains

Short-term capital gains arise from the sale of assets held for one year or less. These gains are taxed at your ordinary income tax rate, which ranges from 10% to 37% depending on your total taxable income and filing status. Essentially, short-term capital gains are treated the same as wages, salary, and other ordinary income for tax purposes. For active traders, day traders, and anyone who frequently buys and sells investments within a one-year window, the short-term rate applies to all profits.

Long-Term Capital Gains

Long-term capital gains arise from the sale of assets held for more than one year. These gains benefit from preferential tax rates that are significantly lower than ordinary income rates. The long-term capital gains tax rates are 0%, 15%, or 20%, depending on your taxable income and filing status. For most taxpayers, the long-term rate is 15%, which is substantially less than their marginal ordinary income tax rate.

The Tax Savings of Long-Term Holding

The difference in tax treatment between short-term and long-term capital gains creates a powerful incentive to hold investments for more than one year. Consider an investor in the 24% ordinary income tax bracket who realizes a $50,000 capital gain. If classified as short-term, the federal tax would be approximately $12,000. If classified as long-term (at the 15% rate), the tax would be $7,500 -- a savings of $4,500 simply by holding the asset for one additional day beyond the one-year mark.

For this reason, tax-efficient investing strategies generally favor holding assets for at least one year before selling. Tax-aware investors will often time their sales to ensure they qualify for long-term treatment, even delaying a sale by a few days or weeks to cross the one-year threshold. This is especially important for large gains where the tax savings can be substantial.

2025 Tax Rate Tables

The following tables show the 2025 federal tax rates for both short-term capital gains (which use ordinary income tax brackets) and long-term capital gains for all filing statuses.

Short-Term Capital Gains Rates (Ordinary Income Brackets) — 2025

Single Filer

Taxable IncomeTax Rate
$0 - $11,92510%
$11,925 - $48,47512%
$48,475 - $103,35022%
$103,350 - $197,30024%
$197,300 - $250,52532%
$250,525 - $626,35035%
Over $626,35037%

Married Filing Jointly

Taxable IncomeTax Rate
$0 - $23,85010%
$23,850 - $96,95012%
$96,950 - $206,70022%
$206,700 - $394,60024%
$394,600 - $501,05032%
$501,050 - $751,60035%
Over $751,60037%

Married Filing Separately

Taxable IncomeTax Rate
$0 - $11,92510%
$11,925 - $48,47512%
$48,475 - $103,35022%
$103,350 - $197,30024%
$197,300 - $250,52532%
$250,525 - $375,80035%
Over $375,80037%

Head of Household

Taxable IncomeTax Rate
$0 - $17,00010%
$17,000 - $64,85012%
$64,850 - $103,35022%
$103,350 - $197,30024%
$197,300 - $250,52532%
$250,525 - $626,35035%
Over $626,35037%

Long-Term Capital Gains Tax Rates — 2025

Single Filer

Taxable IncomeTax Rate
$0 - $48,3500%
$48,350 - $533,40015%
Over $533,40020%

Married Filing Jointly

Taxable IncomeTax Rate
$0 - $96,7000%
$96,700 - $600,05015%
Over $600,05020%

Married Filing Separately

Taxable IncomeTax Rate
$0 - $48,3500%
$48,350 - $300,02515%
Over $300,02520%

Head of Household

Taxable IncomeTax Rate
$0 - $64,7500%
$64,750 - $566,70015%
Over $566,70020%

Note: These income thresholds are based on total taxable income including the capital gain itself. Long-term rates are significantly lower than short-term rates for most taxpayers, making the holding period a critical factor in tax planning.

Net Investment Income Tax (NIIT)

The Net Investment Income Tax (NIIT) is an additional 3.8% surtax on investment income that applies to higher-income taxpayers. Introduced as part of the Affordable Care Act in 2013, the NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds certain thresholds.

The NIIT thresholds for 2025 are:

  • Single: $200,000
  • Married Filing Jointly: $250,000
  • Married Filing Separately: $125,000
  • Head of Household: $200,000

Unlike the regular income tax brackets, these NIIT thresholds are not indexed for inflation and have remained unchanged since the tax was introduced. This means that more taxpayers become subject to the NIIT each year as incomes rise with inflation.

NIIT Calculation Formula:

NIIT = min(Net Investment Income, MAGI - Threshold) x 3.8%

Example: Single filer, $75,000 income + $150,000 gain = $225,000 MAGI

NIIT = min($150,000, $225,000 - $200,000) x 3.8% = $25,000 x 3.8% = $950

Net investment income includes capital gains, dividends, interest, rental income, royalties, and income from passive activities. It does not include wages, self-employment income, Social Security benefits, or distributions from certain retirement plans. The NIIT effectively raises the maximum long-term capital gains rate from 20% to 23.8% for the highest-income taxpayers.

How to Calculate Capital Gains Tax Step-by-Step

Calculating your capital gains tax involves several steps. Here is a comprehensive walkthrough of the process:

  1. Determine your cost basis: This is the original purchase price of the asset, plus any acquisition costs such as broker commissions, transfer fees, or improvements (for real estate). For stocks, your cost basis is typically the price you paid per share multiplied by the number of shares sold.
  2. Determine the sale price: This is the gross proceeds from the sale, minus any selling costs such as broker commissions or closing costs (for real estate).
  3. Calculate the capital gain or loss: Subtract the cost basis from the sale price. If the result is positive, you have a capital gain. If negative, you have a capital loss.
  4. Apply any capital losses: If you have capital losses from other investments, you can use them to offset your capital gains dollar for dollar.
  5. Determine the holding period: Count the days from the day after you purchased the asset to the day you sold it. If more than one year (366 days or more), the gain is long-term. Otherwise, it is short-term.
  6. Apply the appropriate tax rate: Based on your holding period, filing status, and total taxable income, look up the applicable tax rate from the tables above.
  7. Check for NIIT: If your modified adjusted gross income exceeds the NIIT threshold for your filing status, add 3.8% on the applicable portion of your investment income.

Capital Gains Tax Formula:

Capital Gain = Sale Price - Purchase Price - Capital Losses

Tax = Capital Gain x Applicable Tax Rate + NIIT (if applicable)

Effective Rate = Total Tax / Capital Gain x 100

After-Tax Proceeds = Sale Price - Total Tax

Remember that capital gains tax is calculated on the gain, not on the total sale price. Your cost basis -- the amount you originally invested -- is returned to you tax-free. Only the profit above your cost basis is subject to capital gains tax. This is a common point of confusion for new investors who may initially fear that the entire sale amount is taxable.

Capital Losses and Tax-Loss Harvesting

Capital losses occur when you sell an investment for less than your cost basis. While nobody wants to lose money on an investment, capital losses do provide a valuable tax benefit: they can be used to offset capital gains, reducing your overall tax liability.

The IRS requires that losses first offset gains of the same type: short-term losses offset short-term gains, and long-term losses offset long-term gains. If you have net losses remaining after this matching, they can then offset gains of the other type. If your total capital losses exceed your total capital gains for the year, you can deduct up to $3,000 of the excess against your ordinary income ($1,500 if married filing separately). Any losses beyond the $3,000 annual limit are carried forward indefinitely to future tax years.

Tax-Loss Harvesting

Tax-loss harvesting is a strategy where investors intentionally sell investments at a loss to offset realized capital gains. This is particularly useful at year-end when investors review their portfolios for tax planning purposes. By selling underperforming investments, you can generate losses to offset gains from winners, effectively reducing your net capital gains and the associated tax.

There is an important caveat to tax-loss harvesting: the wash sale rule. The IRS prohibits claiming a loss on a security if you purchase a "substantially identical" security within 30 days before or after the sale. This prevents investors from selling solely for the tax benefit and immediately repurchasing the same investment. To comply with the wash sale rule, you can either wait 31 days before repurchasing the same security, or purchase a similar (but not substantially identical) investment to maintain your portfolio allocation.

When used strategically, tax-loss harvesting can save investors significant amounts in capital gains tax over time. Many financial advisors and robo-advisors offer automated tax-loss harvesting services that monitor portfolios daily for harvesting opportunities. For a deeper look at how investment returns compound over time, check out our Investment Calculator.

Real-World Examples

Example 1: Short-Term Stock Sale

Maria, a single filer with $85,000 in annual taxable income, purchased 200 shares of a tech stock at $50 per share ($10,000 total) in March 2025. Eight months later, she sells all 200 shares at $75 per share ($15,000 total). Since she held the stock for less than one year, this is a short-term capital gain.

Capital Gain = $15,000 - $10,000 = $5,000
Maria's income ($85,000) places the gain in the 22% bracket
Short-term tax = $5,000 x 22% = $1,100
NIIT: Not applicable ($90,000 total income < $200,000 threshold)
Total tax = $1,100
Effective rate = 22.0%
After-tax proceeds = $15,000 - $1,100 = $13,900

If Maria had held the stock for just four more months (more than one year), the gain would qualify as long-term. Her total income of $90,000 would place her in the 15% long-term bracket, resulting in a tax of $750 instead of $1,100 -- a savings of $350 simply by waiting.

Example 2: Long-Term Real Estate Sale

David and Sarah, married filing jointly with $180,000 in combined annual taxable income, purchased a rental property in 2019 for $300,000. In 2025, they sell it for $450,000 after deducting $15,000 in selling costs (real estate commission and closing costs). They held the property for over 6 years, so this is a long-term capital gain. They also have $8,000 in capital losses from selling other investments at a loss.

Adjusted sale price = $450,000 - $15,000 = $435,000
Capital Gain = $435,000 - $300,000 = $135,000
After capital losses = $135,000 - $8,000 = $127,000
Total income = $180,000 + $127,000 = $307,000
Long-term bracket: $96,700 to $600,050 at 15%
Long-term tax = $127,000 x 15% = $19,050
NIIT: $307,000 > $250,000 threshold
NIIT = min($127,000, $307,000 - $250,000) x 3.8%
NIIT = $57,000 x 3.8% = $2,166
Total tax = $19,050 + $2,166 = $21,216
Effective rate = $21,216 / $127,000 = 16.7%
After-tax proceeds = $435,000 - $21,216 = $413,784

Note: This example simplifies real estate taxation. In practice, depreciation recapture (taxed at 25%) would apply to any depreciation previously claimed on the rental property, and state taxes would add to the liability. Depreciation recapture is calculated before applying long-term capital gains rates to the remaining gain.

Example 3: Mixed Portfolio with Gains and Losses

James, a single filer with $120,000 in annual taxable income, has the following investment activity in 2025:

  • Stock A: Bought for $20,000, sold for $35,000 (held 2 years) — long-term gain of $15,000
  • Stock B: Bought for $15,000, sold for $10,000 (held 6 months) — short-term loss of $5,000
  • Stock C: Bought for $8,000, sold for $12,000 (held 3 months) — short-term gain of $4,000

Short-term gains: $4,000 (Stock C)
Short-term losses: $5,000 (Stock B)
Net short-term: -$1,000 (loss)

Long-term gains: $15,000 (Stock A)
Long-term losses: $0
Net long-term: $15,000 (gain)

Net short-term loss offsets long-term gain:
Taxable long-term gain = $15,000 - $1,000 = $14,000
Total income = $120,000 + $14,000 = $134,000
Long-term rate: 15% (within $48,350 - $533,400 bracket)
Long-term tax = $14,000 x 15% = $2,100
NIIT: Not applicable ($134,000 < $200,000)
Total tax on investment activity = $2,100
Effective rate = 15.0%

This example illustrates the value of netting gains and losses. James's short-term loss from Stock B reduced his taxable long-term gain by $1,000, saving him $150 in taxes (at the 15% long-term rate). If he had additional short-term losses, they could further reduce or even eliminate the taxable gain. See our Salary Calculator to understand how ordinary income brackets affect your short-term capital gains rate.

Strategies for Minimizing Capital Gains Tax

While capital gains taxes are an unavoidable part of successful investing, there are several legitimate strategies to minimize your tax liability:

  1. Hold investments for more than one year: The single most effective strategy for most investors. Long-term capital gains rates (0%, 15%, 20%) are significantly lower than short-term rates (10% to 37%). If you are close to the one-year mark, delaying a sale by even a few days can result in substantial tax savings.
  2. Use tax-advantaged accounts: Invest through 401(k)s, IRAs, Roth IRAs, and Health Savings Accounts (HSAs) when possible. In a traditional 401(k) or IRA, capital gains are tax-deferred until withdrawal. In a Roth IRA, qualified withdrawals (including gains) are completely tax-free. HSAs offer triple tax advantages: tax-deductible contributions, tax-free growth, and tax-free withdrawals for qualified medical expenses.
  3. Harvest tax losses: As described above, selling losing investments to offset gains can reduce your overall tax liability. Be mindful of the wash sale rule when implementing this strategy.
  4. Take advantage of the 0% rate: If your taxable income is low enough (under $48,350 for single filers in 2025), you may qualify for the 0% long-term capital gains rate. This is particularly useful for retirees or during years with lower income. You can strategically realize gains in low-income years to lock in the 0% rate.
  5. Gift appreciated assets: Instead of selling appreciated assets yourself, consider gifting them to family members in lower tax brackets. The recipient assumes your cost basis but may pay a lower tax rate on the gain when they sell. Annual gift tax exclusions allow gifts of up to $18,000 per recipient in 2025 without triggering gift tax.
  6. Donate appreciated assets to charity: If you donate appreciated long-term assets directly to a qualified charity, you can deduct the full market value as a charitable contribution while avoiding capital gains tax entirely. This is more tax-efficient than selling the asset and donating the cash proceeds.
  7. Use specific identification for cost basis: When selling shares of a stock or fund you purchased at different times and prices, you can use specific identification to select which shares to sell. By choosing shares with the highest cost basis, you minimize your capital gain and the resulting tax.
  8. Consider Qualified Opportunity Zones: Investing capital gains into a Qualified Opportunity Zone (QOZ) fund can defer and potentially reduce capital gains tax. If you hold the QOZ investment for 10 or more years, any appreciation in the QOZ investment itself may be excluded from tax entirely.
  9. Plan around life changes: Major life events such as retirement, job changes, sabbaticals, or relocating to a state with no income tax can create opportunities to realize gains at lower rates. Plan asset sales during years when your taxable income is expected to be lower.
  10. Use installment sales: For large gains, particularly on real estate, an installment sale allows you to spread the gain over multiple tax years, potentially keeping more of the gain in lower tax brackets. This can also help avoid or reduce the NIIT by keeping annual income below the threshold.

For more information on how compound growth and investment returns work over time, explore our Investment Calculator to project your portfolio growth with different contribution amounts and return rates.

Primary Residence Exclusion ($250k/$500k)

One of the most generous tax provisions for individuals is the primary residence capital gains exclusion under Section 121 of the Internal Revenue Code. This provision allows homeowners to exclude a significant portion of the profit from selling their primary residence from capital gains tax.

The exclusion amounts are:

  • Single filers: Up to $250,000 in capital gains can be excluded from tax
  • Married filing jointly: Up to $500,000 in capital gains can be excluded from tax

To qualify for the exclusion, you must meet two requirements:

  • Ownership test: You must have owned the home for at least 2 of the 5 years preceding the sale
  • Use test: You must have used the home as your primary residence for at least 2 of the 5 years preceding the sale

The 2 years do not need to be consecutive. For example, if you lived in a home for 2 years, rented it out for 2 years, then sold it, you would still qualify because you used it as your primary residence for 2 of the last 5 years. You can use this exclusion once every 2 years.

Primary Residence Exclusion Example:

Purchase price: $350,000 (bought in 2020)

Sale price: $550,000 (sold in 2025)

Capital gain: $550,000 - $350,000 = $200,000

Single filer exclusion: $250,000

Taxable gain: $0 (gain is fully within the exclusion)

Tax owed: $0

If the gain exceeds the exclusion amount, only the excess is subject to capital gains tax. For example, a married couple with a $600,000 gain would exclude $500,000 and pay tax only on the remaining $100,000. The gain would be classified as long-term (assuming they owned the home for more than one year), qualifying for the preferential long-term capital gains rates.

There are partial exclusions available for homeowners who do not meet the full 2-year requirement due to unforeseen circumstances such as a change in employment, health issues, or other qualifying events. The partial exclusion is calculated by prorating the full exclusion amount based on the fraction of the 2-year requirement that was met.

This exclusion makes homeownership one of the most tax-advantaged forms of investment available to individuals. A married couple could potentially realize $500,000 in tax-free capital gains every two years by selling their primary residence, though this strategy is limited by the practical considerations of purchasing, living in, and selling homes.

Important Tax Disclaimer

This guide and the accompanying calculator are provided for educational and informational purposes only. They are not intended to be, and should not be construed as, tax advice. Tax laws are complex and subject to change. Individual circumstances such as state taxes, deductions, credits, alternative minimum tax (AMT), depreciation recapture, and other factors can significantly affect your actual tax liability. Always consult a qualified tax professional, CPA, or tax attorney for advice specific to your situation. The information presented here is based on 2025 federal tax law and may not reflect subsequent legislative changes.