Skip to main content
⚠ Disclaimer: This content is for informational and educational purposes only and does not constitute financial, tax, or investment advice. Results from calculators are estimates and may not reflect your actual situation. Consult a qualified financial professional before making financial decisions. Full terms

Capital Gains Tax Calculator

Estimate the capital gains tax you owe from selling investments or property, including options for short-term and long-term ownership periods, filing status, and state taxes.

Capital Gains Calculator

Enter your purchase and sale details below to estimate federal and state capital gains taxes.

Capital Gain
$0
Federal Capital Gains Tax
$0
State Capital Gains Tax
$0
Total Capital Gains Tax
$0

Real-World Example: Putting the Capital Gains Tax to Work

Let's calculate taxes for a typical scenario.

Scenario: Michael is a single filer earning $85,000 in gross income. He contributes $6,500 to a traditional 401(k) and claims the standard deduction.

  • Gross income: $85,000
  • 401(k) contribution: -$6,500
  • Adjusted Gross Income: $78,500
  • Standard deduction: -$14,600
  • Taxable income: $63,900

Using the progressive tax brackets: the first $11,600 is taxed at 10% ($1,160), income from $11,601-$47,150 at 12% ($4,266), and income from $47,151-$63,900 at 22% ($3,685). His total federal tax is approximately $9,111, giving him an effective tax rate of 10.7% — well below his marginal rate of 22%.

If Michael increases his 401(k) contribution to $15,000, his taxable income drops to $55,400, reducing his federal tax to approximately $7,239 — saving $1,872 in taxes while building retirement savings. This calculator helps model these tax-saving strategies.

Formula and Methodology: Capital Gains Tax Formula

Capital Gain = Sale Price - Purchase Price - Selling Costs - Improvements Tax = Capital Gain × Tax Rate

Where:

  • Sale Price — The amount received from selling the asset
  • Purchase Price (Cost Basis) — The original purchase price plus any buying costs (commissions, fees)
  • Selling Costs — Expenses of the sale (broker commissions, transfer fees)
  • Tax Rate — Short-term: your ordinary income tax rate (10-37%). Long-term (held >1 year): 0%, 15%, or 20% based on income

Worked Example

Bought stock for $10,000, sold for $15,000 after 2 years with $100 in commissions. Capital Gain = $15,000 - $10,000 - $100 = $4,900. At the 15% long-term rate: Tax = $4,900 × 0.15 = $735.

Limitations and Assumptions

Long-term capital gains rates (0%, 15%, 20%) apply to assets held more than one year. The 0% rate applies to taxable income up to $44,625 (single) in 2024. The Net Investment Income Tax adds 3.8% for high earners above $200,000 (single). Capital losses can offset gains dollar-for-dollar, plus up to $3,000 of ordinary income per year.

Scenario Comparison: Long-Term Capital Gains Tax Rates by Income (2024)

Federal long-term capital gains tax rates for single filers based on taxable income.

Taxable IncomeCapital Gains RateTax on $10,000 GainNet After Tax
Under $44,6250%$0$10,000
$44,626 - $492,30015%$1,500$8,500
Over $492,30020%$2,000$8,000
$200K+ (NIIT applies)15% + 3.8%$1,880$8,120
$500K+ (NIIT applies)20% + 3.8%$2,380$7,620

Frequently Asked Questions

The U.S. uses a progressive tax system where only the income within each bracket is taxed at that brackets rate. For example, if you earn $50,000 as a single filer, you do not pay 22% on all $50,000. Instead, the first $11,600 is taxed at 10%, income from $11,601-$47,150 at 12%, and only income from $47,151-$50,000 at 22%. Your effective tax rate (total tax divided by total income) is much lower than your marginal rate (the rate on your highest dollar).

Common deductions include the standard deduction ($14,600 for single filers, $29,200 for married filing jointly in 2024), or itemized deductions if they exceed the standard amount. Itemizable expenses include state and local taxes (SALT, capped at $10,000), mortgage interest, charitable contributions, and medical expenses exceeding 7.5% of AGI. Above-the-line deductions like IRA contributions, student loan interest, and HSA contributions reduce income regardless of whether you itemize.

Tax deductions reduce your taxable income — a $1,000 deduction saves you $220 in taxes if you are in the 22% bracket. Tax credits reduce your actual tax bill dollar-for-dollar — a $1,000 credit saves you exactly $1,000 regardless of your bracket. Credits are always more valuable. Common credits include the Child Tax Credit ($2,000 per child), Earned Income Tax Credit, education credits (American Opportunity and Lifetime Learning), and energy efficiency credits.

The most impactful strategies include: maximizing contributions to tax-deferred accounts (401k, Traditional IRA, HSA), harvesting investment losses to offset gains, timing large deductions strategically, taking advantage of all eligible credits, contributing to charitable organizations (including donor-advised funds), and structuring business income optimally if self-employed. Long-term capital gains are taxed at lower rates than short-term gains, so holding investments over one year reduces taxes on profits.

Consider a tax professional if you have self-employment income, rental properties, stock options, significant investment gains/losses, major life changes (marriage, home purchase, inheritance), or international income. Simple returns (W-2 income, standard deduction, basic credits) can typically be filed accurately using tax software. The cost of a CPA ($200-500 for a moderately complex return) is often worth it for the deductions and strategies they identify that you might miss.

Related Articles

View All Articles

Financial Disclaimer: The information provided on this page is for general educational and informational purposes only and does not constitute financial, tax, or legal advice. Tax laws change frequently, and individual circumstances vary. Always consult a qualified tax professional, Certified Public Accountant (CPA), or enrolled agent before making investment decisions or filing your tax return. myUSFinance is not a registered investment advisor, and the calculator results are estimates only — they should not be relied upon as precise tax computations. Past tax rates do not guarantee future rates.

Understanding Capital Gains Tax


What Is Capital Gains Tax?

Capital gains tax is a federal tax imposed on the profit you realize when you sell a capital asset — such as stocks, bonds, mutual funds, real estate, or cryptocurrency — for more than you originally paid. The United States tax code distinguishes between two types of capital gains, and the distinction has a significant impact on how much tax you owe.

Short-Term vs. Long-Term Capital Gains

The holding period determines whether a gain is classified as short-term or long-term. If you hold an asset for one year or less before selling, any profit is a short-term capital gain and is taxed at your ordinary income tax rate — which can be as high as 37% for the highest earners. If you hold the asset for more than one year, the profit qualifies as a long-term capital gain and benefits from preferential tax rates of 0%, 15%, or 20%, depending on your taxable income and filing status.

This difference alone can represent thousands of dollars in tax savings, which is why strategic investors pay close attention to holding periods before selling assets.

2026 Federal Long-Term Capital Gains Tax Rates

For the 2026 tax year, the federal long-term capital gains rates remain structured across three tiers. These rates apply to net long-term capital gains after offsetting any capital losses:

  • 0% Rate — Applies to taxpayers in the lowest income brackets. For single filers, this generally covers taxable income up to approximately $48,350; for married filing jointly, up to about $96,700.
  • 15% Rate — The most common rate, applying to single filers with taxable income between roughly $48,351 and $533,400, and married filing jointly between approximately $96,701 and $600,050.
  • 20% Rate — Reserved for high-income taxpayers above the 15% thresholds. Additionally, high earners may owe the 3.8% Net Investment Income Tax (NIIT), pushing the effective top rate to 23.8%.

Short-term capital gains, by contrast, are taxed at ordinary income rates: 10%, 12%, 22%, 24%, 32%, 35%, or 37% for the 2026 tax year.

Cost Basis Methods

Your cost basis is the original value of an asset for tax purposes, usually the purchase price plus certain allowable adjustments like commissions, fees, and improvements (for real estate). The IRS allows several methods for determining cost basis:

  • Specific Identification — You choose exactly which shares or lots to sell, giving you maximum control over gains and losses.
  • First In, First Out (FIFO) — The oldest shares are assumed to be sold first. This is the default method if you do not specify otherwise.
  • Average Cost — Permitted only for mutual fund shares and certain dividend reinvestment plans; the cost basis is the average price of all shares owned.
  • Last In, First Out (LIFO) — The most recently purchased shares are sold first, which can minimize gains in a rising market.

Choosing the right cost basis method can significantly affect your tax liability. For example, using specific identification during a volatile market lets you strategically sell higher-cost-basis lots first, reducing your taxable gain.

The Wash Sale Rule

The wash sale rule (IRC Section 1091) prevents taxpayers from claiming an artificial tax loss by selling a security at a loss and repurchasing a "substantially identical" security within 30 days before or after the sale — creating a 61-day window. If a wash sale is triggered, the disallowed loss is added to the cost basis of the replacement security, deferring (but not permanently eliminating) the loss. This rule applies to stocks, bonds, options, and mutual funds, and the IRS also applies it across accounts, including IRAs. Cryptocurrency, as of 2026, is also subject to wash sale rules following recent legislative changes.


How to Calculate Your Capital Gains Tax

Follow these steps to estimate your capital gains tax liability using our calculator or by hand:

  1. Determine your cost basis — Add the purchase price of the asset plus any transaction fees, commissions, or improvement costs.
  2. Calculate the sale proceeds — Subtract selling expenses (broker commissions, transfer fees) from the total sale price.
  3. Compute the capital gain (or loss) — Subtract the adjusted cost basis from the net sale proceeds.
  4. Identify the holding period — Count from the day after the purchase date to the sale date. More than 365 days qualifies as long-term.
  5. Apply the correct tax rate — Use ordinary income rates for short-term gains or the preferential 0%/15%/20% rates for long-term gains.
  6. Offset with capital losses — You can use capital losses to offset capital gains dollar-for-dollar. Excess losses can offset up to $3,000 of ordinary income per year, with remaining losses carried forward.

Capital Gains Tax Formula

Capital Gain = Sale Price − Selling Costs − (Purchase Price + Buying Costs)

Tax Owed = Capital Gain × Applicable Tax Rate
Worked Example: You purchased 100 shares of XYZ Corp at $50/share ($5,000 total) plus a $10 commission, for a cost basis of $5,010. Two years later, you sell all 100 shares at $80/share ($8,000 total) minus a $10 commission, netting $7,990 in proceeds.

Capital Gain: $7,990 − $5,010 = $2,980 (long-term, held > 1 year)
Tax Rate: Assuming you are a single filer with $75,000 in taxable income, you fall in the 15% long-term bracket.
Tax Owed: $2,980 × 15% = $447.00

Short-Term vs. Long-Term Capital Gains Tax Rates by Income Bracket (2026)

The table below illustrates the stark difference between short-term and long-term rates for a single filer:

Taxable Income (Single Filer) Short-Term Rate (Ordinary Income) Long-Term Rate Potential Savings on $10,000 Gain
Up to $11,92510%0%$1,000
$11,926 – $48,47512%0%$1,200
$48,476 – $103,35022%15%$700
$103,351 – $197,30024%15%$900
$197,301 – $250,52532%15%$1,700
$250,526 – $394,60035%15%$2,000
$394,601 – $533,40035%15%$2,000
Over $533,40037%20%$1,700

As the table shows, long-term rates provide meaningful tax savings across every income level, with the greatest benefit at middle-to-high income brackets.


5 Tax-Saving Strategies for Capital Gains

  1. Hold Assets for More Than One Year — The simplest strategy: by waiting at least 366 days before selling, you convert a short-term gain into a long-term gain, potentially reducing your tax rate from 37% to as low as 0%. This "buy and hold" approach rewards patient investors.
  2. Tax-Loss Harvesting — Strategically sell underperforming investments at a loss to offset your capital gains. For example, if you realize a $10,000 gain and a $6,000 loss, you only owe tax on the net $4,000 gain. Be mindful of the wash sale rule when re-entering positions.
  3. Use Tax-Advantaged Accounts — Invest through 401(k)s, Traditional IRAs, or Roth IRAs. Gains within Traditional accounts are tax-deferred, while gains in Roth accounts are completely tax-free in retirement. This eliminates capital gains tax on trades within the account entirely.
  4. Gift Appreciated Assets to Charity — Donating securities you have held for over a year directly to a qualified charity lets you deduct the full fair market value while avoiding capital gains tax altogether. This is one of the most powerful strategies for philanthropic high-income investors.
  5. Leverage the Primary Residence Exclusion — If you sell your primary home and have lived in it for at least 2 of the last 5 years, you can exclude up to $250,000 in gains ($500,000 for married filing jointly) from taxation under IRC Section 121. This exclusion can be used once every two years.

Frequently Asked Questions About Capital Gains Tax

An unrealized gain exists when your asset has increased in value but you have not yet sold it — it is a "paper gain" and is not taxable. A realized gain occurs when you actually sell or exchange the asset and lock in the profit. Only realized gains are subject to capital gains tax. This distinction is important because you have full control over when you trigger a taxable event.

Yes, but with limits. Capital losses first offset capital gains of the same type (short-term losses offset short-term gains; long-term losses offset long-term gains). Any remaining net capital loss can offset up to $3,000 per year ($1,500 if married filing separately) of ordinary income. Losses exceeding this threshold are carried forward indefinitely to future tax years.

Inherited assets receive a stepped-up basis, meaning the cost basis is reset to the fair market value on the date of the decedent's death. If you inherit stock worth $100,000 that was originally purchased for $20,000, your basis is $100,000 — not $20,000. If you sell immediately at $100,000, you owe zero capital gains tax. This is one of the most significant tax benefits in the U.S. tax code.

Yes. The IRS treats cryptocurrency as property, not currency. Every time you sell, exchange, or spend crypto, it is a taxable event. The same short-term and long-term holding period rules apply. If you hold Bitcoin for more than a year before selling, the gain is taxed at long-term rates. As of 2026, crypto is also subject to the wash sale rule, so you cannot sell at a loss and immediately repurchase the same token to claim the loss.

The NIIT is an additional 3.8% surtax on net investment income — including capital gains, dividends, interest, and rental income — for individuals with modified adjusted gross income (MAGI) above $200,000 (single) or $250,000 (married filing jointly). This means the top effective long-term capital gains rate is actually 23.8% (20% + 3.8%), not just 20%. The NIIT was established by the Affordable Care Act and remains in effect for 2026.

Capital gains and losses are reported on Schedule D (Form 1040) and Form 8949. Form 8949 lists each individual transaction with dates, cost basis, proceeds, and gain or loss. Schedule D summarizes the totals and calculates your net gain or loss. Your brokerage will provide Form 1099-B with the transaction details you need. If you use tax preparation software, it will typically import this data directly from your broker.


Related Calculators