Federal Capital Gains Tax Calculator
Estimate your federal tax on an investment sale by entering your filing status, current taxable income, cost basis, selling costs, and whether your gain is short-term or long-term. This calculator also offers an optional estimate for the 3.8% Net Investment Income Tax.
Your estimate
Enter your details and click the calculate button to view your federal capital gains tax estimate, taxable gain, after-tax proceeds, and a visual chart.
Expert Guide: How a Federal Capital Gains Tax Calculator Works
A federal capital gains tax calculator helps investors estimate how much of a profit from selling an asset may be owed to the Internal Revenue Service. If you sell stocks, exchange traded funds, mutual funds, a business interest, investment real estate, or other capital assets for more than your tax basis, the gain may be taxable. The amount of tax depends on several moving parts, including how long you held the asset, your filing status, your taxable income, and whether surtaxes such as the Net Investment Income Tax may apply.
The reason so many people search for a federal capital gains tax calculator is simple: capital gains tax rules are not flat or one-size-fits-all. Short-term gains are generally taxed at ordinary income tax rates, while long-term gains often receive preferential federal rates of 0%, 15%, or 20%. That difference can change the economics of a sale dramatically. Selling an appreciated investment a few weeks too early can mean a significantly larger tax bill. A high-quality calculator gives you a practical estimate before you sell, so you can make better timing, tax planning, and cash flow decisions.
What counts as a capital gain?
A capital gain is the difference between the amount you realize on a sale and your adjusted basis in the asset. In practical terms, most taxpayers begin with the sale price, subtract eligible selling costs, and compare the result with their cost basis. Basis often starts with what you paid for the asset, then may increase if you made capital improvements or paid certain acquisition costs. If your adjusted basis is higher, your taxable gain is lower. If your basis is lower, the gain is larger.
This page uses that general framework. You enter your purchase price, improvement costs, selling costs, and sale proceeds. The calculator then estimates your net gain and applies the appropriate federal tax treatment based on your holding period and filing status.
Short-term vs long-term capital gains
The most important distinction in capital gains tax planning is the holding period. If you owned the asset for one year or less, any gain is generally short-term. Short-term gains are usually taxed at the same rates as wages and other ordinary income. That means your gain can be subject to the federal income tax bracket that applies to your household.
If you owned the asset for more than one year, the gain is typically long-term. Long-term gains receive preferential tax treatment. For many taxpayers, that means a 15% federal capital gains rate, although some taxpayers fall into the 0% bracket and higher-income households may pay 20%. Because the federal tax code uses a stacking approach for long-term gains, your other taxable income matters. Your wages, self-employment income, pensions, and other taxable income fill the lower layers first, and then the long-term gain is taxed based on where it lands above those thresholds.
2024 long-term capital gains tax thresholds
The table below summarizes the 2024 federal long-term capital gains rate thresholds that many taxpayers use when estimating potential tax. These figures are widely referenced for planning because they determine whether your long-term gain is taxed at 0%, 15%, or 20%.
| Filing status | 0% rate applies up to taxable income of | 15% rate applies over that amount and up to | 20% rate applies above |
|---|---|---|---|
| Single | $47,025 | $518,900 | $518,900 |
| Married Filing Jointly | $94,050 | $583,750 | $583,750 |
| Married Filing Separately | $47,025 | $291,850 | $291,850 |
| Head of Household | $63,000 | $551,350 | $551,350 |
These brackets matter because a taxpayer with moderate taxable income may have part of a long-term gain taxed at 0%, another part at 15%, and none at 20%. Meanwhile, a higher-income taxpayer may owe 20% on a portion of the same gain. A calculator that uses the stacking method can provide a more realistic estimate than a simple flat-rate shortcut.
2024 ordinary income tax rates for short-term gains
For short-term gains, the federal government generally treats your profit like ordinary income. The rate can vary from 10% up to 37% depending on your filing status and your taxable income. The calculator on this page estimates short-term tax by measuring the incremental tax on your taxable income with and without the added gain.
| Rate | Single taxable income | Married Filing Jointly taxable income | Head of Household taxable income |
|---|---|---|---|
| 10% | Up to $11,600 | Up to $23,200 | Up to $16,550 |
| 12% | $11,601 to $47,150 | $23,201 to $94,300 | $16,551 to $63,100 |
| 22% | $47,151 to $100,525 | $94,301 to $201,050 | $63,101 to $100,500 |
| 24% | $100,526 to $191,950 | $201,051 to $383,900 | $100,501 to $191,950 |
| 32% | $191,951 to $243,725 | $383,901 to $487,450 | $191,951 to $243,700 |
| 35% | $243,726 to $609,350 | $487,451 to $731,200 | $243,701 to $609,350 |
| 37% | Over $609,350 | Over $731,200 | Over $609,350 |
Why your cost basis matters so much
One of the most common mistakes taxpayers make is underestimating their basis. If you only look at the original purchase price and ignore eligible basis increases, you may overstate your taxable gain. For example, if you bought an investment property, made permanent improvements, and later paid significant selling expenses when you sold, your taxable gain may be smaller than the raw difference between purchase price and sale price.
- Purchase price is often the starting point of basis.
- Capital improvements can increase basis and reduce gain.
- Selling costs can reduce the amount realized on the sale.
- Prior capital losses may offset current gains.
The calculator above includes fields for improvements, selling costs, and a capital loss carryforward. These inputs can materially affect your estimate. Although every tax situation has details, using a broader basis formula usually produces a much more useful planning result than focusing on purchase price and sale price alone.
How the Net Investment Income Tax can affect the result
Higher-income taxpayers may also face the 3.8% Net Investment Income Tax, often called NIIT. This surtax can apply when modified adjusted gross income exceeds statutory thresholds. In broad terms, it applies to the lesser of net investment income or the amount by which modified adjusted gross income exceeds the threshold. For many investors, a large capital gain can push income over the threshold and create an additional tax cost beyond the regular capital gains rate.
The threshold amounts commonly used for NIIT planning are:
- $200,000 for Single and Head of Household
- $250,000 for Married Filing Jointly
- $125,000 for Married Filing Separately
Because NIIT calculations can become technical, this page includes it as an optional estimate. If selected, the calculator compares your entered income plus net gain with the threshold for your filing status and estimates the surtax on the applicable amount.
How to use a federal capital gains tax calculator effectively
- Choose the correct filing status. Your thresholds and rates depend on it.
- Use taxable income, not gross salary. For the most useful estimate, enter taxable income before this sale.
- Include all basis adjustments you can document. Improvements and eligible costs may reduce your gain.
- Set the right holding period. A short-term sale can produce a much larger tax bill.
- Consider prior capital losses. Loss carryforwards can offset gains and reduce tax.
- Check NIIT if you are a higher-income taxpayer. It can meaningfully increase the total federal burden.
Planning scenarios where this calculator is especially useful
This type of tool is valuable in many real-world situations. Stock investors may use it before rebalancing a portfolio. Business owners may estimate tax on a partial interest sale. Landlords and real estate investors may use it as a quick screening tool before discussing a transaction with a CPA. Families deciding whether to sell inherited or appreciated investments can compare a sale this year with a sale next year. Even retirees often use a federal capital gains tax calculator to see whether a sale can fit into a lower income year.
It is also useful for timing decisions. A long-term gain sold in a lower-income year may generate a lower federal tax rate. Investors sometimes coordinate gains with deductible losses, charitable giving, retirement contributions, or installment sale structures to improve the outcome. A calculator is not a substitute for professional advice, but it gives you a strong first estimate that can guide those conversations.
Common limitations and important caveats
No online calculator can capture every rule in the Internal Revenue Code. For example, some sales may involve depreciation recapture, qualified small business stock exclusions, opportunity zone rules, collectibles rates, wash sale interactions, or special treatment for a primary residence. State income taxes are also not included here, and those can be substantial depending on where you live. If your transaction involves a home sale exclusion under Section 121, business assets, inherited property basis issues, or trust taxation, the correct result may differ meaningfully from a general estimate.
Still, a high-quality federal capital gains tax calculator remains extremely useful because it helps you answer the central question quickly: if I sell this asset, approximately how much federal tax should I plan for? That number can shape your estimated payments, reserve planning, and negotiating strategy.
Authoritative sources for federal capital gains tax research
If you want to validate tax rules or go deeper, start with primary or highly authoritative educational sources. These are especially useful when you need details on reporting, basis rules, or NIIT thresholds:
- IRS Topic No. 409: Capital Gains and Losses
- IRS guidance on the Net Investment Income Tax
- Cornell Law School Legal Information Institute: U.S. tax code reference
Bottom line
A federal capital gains tax calculator is one of the most practical planning tools an investor can use. It lets you estimate tax before selling, compare short-term and long-term outcomes, see how basis changes affect your gain, and test whether higher-income surtaxes may apply. Used properly, it can help you avoid surprises, improve timing, and make smarter after-tax decisions.
For the best estimate, use accurate taxable income numbers, include all documented basis adjustments, and remember that this is a planning tool rather than legal or tax advice. If your transaction is large or complex, take your calculator output to a qualified tax professional and review the details together before filing.