myUSFinance
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.
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 Income | Capital Gains Rate | Tax on $10,000 Gain | Net After Tax |
|---|---|---|---|
| Under $44,625 | 0% | $0 | $10,000 |
| $44,626 - $492,300 | 15% | $1,500 | $8,500 |
| Over $492,300 | 20% | $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
Related Articles
View All ArticlesFinancial 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:
- Determine your cost basis — Add the purchase price of the asset plus any transaction fees, commissions, or improvement costs.
- Calculate the sale proceeds — Subtract selling expenses (broker commissions, transfer fees) from the total sale price.
- Compute the capital gain (or loss) — Subtract the adjusted cost basis from the net sale proceeds.
- Identify the holding period — Count from the day after the purchase date to the sale date. More than 365 days qualifies as long-term.
- Apply the correct tax rate — Use ordinary income rates for short-term gains or the preferential 0%/15%/20% rates for long-term gains.
- 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
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,925 | 10% | 0% | $1,000 |
| $11,926 – $48,475 | 12% | 0% | $1,200 |
| $48,476 – $103,350 | 22% | 15% | $700 |
| $103,351 – $197,300 | 24% | 15% | $900 |
| $197,301 – $250,525 | 32% | 15% | $1,700 |
| $250,526 – $394,600 | 35% | 15% | $2,000 |
| $394,601 – $533,400 | 35% | 15% | $2,000 |
| Over $533,400 | 37% | 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
- 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.
- 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.
- 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.
- 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.
- 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.