Capital Gains Tax Calculator (US Federal)
Free capital gains tax calculator: enter your purchase price, sale price, holding period, and other taxable income to estimate the US federal tax on a long-term or short-term gain.
What Is Capital Gains Tax?
Capital gains tax is the US federal tax on the profit from selling an asset -- stock, a mutual fund, cryptocurrency, or other investment property -- for more than you paid for it. How much you owe depends heavily on how long you held the asset: a long-term gain (held over one year) is taxed at preferential rates of 0%, 15%, or 20%, while a short-term gain (held one year or less) is taxed at the same rates as your ordinary income, which are usually higher.
This calculator estimates the US federal tax on a single sale by stacking the gain on top of your other taxable income and applying the appropriate rate schedule. It intentionally covers federal tax only, using a simple long-term/short-term split -- it does not model state capital gains tax (which varies widely by state) or the 3.8% Net Investment Income Tax that can apply to higher earners, so treat the result as a starting estimate rather than a final tax bill.
How to Use This Capital Gains Tax Calculator
- Enter your purchase price and sale price The purchase price is your cost basis -- what you originally paid for the asset, including any fees.
- Choose the holding period Select long-term if you held the asset over one year, or short-term if you held it one year or less.
- Enter your other taxable income Your taxable income from wages and other sources, not counting this gain -- this determines which rate bracket the gain falls into.
- Select your filing status Single, Married Filing Jointly, or Head of Household -- each has different rate bracket thresholds.
Tips for getting more out of it
- If a sale is close to the one-year holding mark, check the exact purchase date -- waiting even a few extra days can shift a gain from the higher short-term rates to the preferential long-term schedule.
- This calculator uses your other taxable income to determine which rate bracket the gain falls into, so use your income after deductions (taxable income), not your gross salary, for the most accurate estimate.
- Remember that this estimate covers federal tax only -- if you live in a state that taxes capital gains, add your state's rate separately to get a fuller picture of your total tax bill.
- Selling multiple lots of the same investment at a loss in the same year can offset gains elsewhere in your portfolio, which is why many investors review their full year of trades together rather than one sale at a time.
- High earners should budget for the additional 3.8% Net Investment Income Tax on top of the federal estimate shown here if their income is above the relevant threshold for their filing status.
When to Use a Capital Gains Tax Calculator
Deciding whether to sell now or wait a year
Compare the short-term rate you would pay today against the long-term rate you would pay if you held the asset past the one-year mark.
Estimating taxes before a large stock sale
See roughly how much of the proceeds from selling appreciated stock or a mutual fund you will actually keep after federal tax.
Planning around a rate bracket threshold
Check whether a gain would push your income across the 0%/15% or 15%/20% long-term thresholds, since only the portion above the threshold is taxed at the higher rate.
Comparing a taxable brokerage sale with a tax-advantaged account
See the federal tax cost of realizing a gain in a regular brokerage account, as a reference point against IRA or 401(k) accounts where gains are not currently taxed.
Capital Gains Tax Glossary
- Capital gain
- The profit from selling an asset for more than its cost basis (what you paid for it).
- Capital loss
- The loss from selling an asset for less than its cost basis. It is not taxed, and can generally offset other gains or a limited amount of ordinary income.
- Cost basis
- The original purchase price of an asset, typically including commissions or fees, used to calculate the gain or loss when it is sold.
- Long-term capital gain
- A gain on an asset held for more than one year before selling, taxed at preferential rates of 0%, 15%, or 20% depending on total taxable income.
- Short-term capital gain
- A gain on an asset held for one year or less before selling, taxed at the same rates as ordinary income (wages), which are usually higher than long-term rates.
- Net Investment Income Tax (NIIT)
- An additional 3.8% federal surtax on investment income (including capital gains) for taxpayers with income above certain thresholds. Not included in this calculator.
Capital Gains Tax Calculator FAQ
Side Note -- Why the One-Year Mark Matters So Much
The dividing line between long-term and short-term capital gains -- exactly one year -- has been part of the US tax code in some form since the 1920s, and it exists to encourage patient, long-term investing rather than rapid buying and selling. Because short-term gains are taxed at the same rates as wages, while long-term gains get a preferential 0/15/20% schedule, the difference in tax owed on an identical dollar gain can be substantial simply based on whether you sold one day before or one day after the anniversary of your purchase.
This is part of why brokerages and tax software so often nudge investors to check the purchase date before selling a position that is close to the one-year mark. It is a rare case in the tax code where a single day can meaningfully change the outcome, and it explains why "wash sale" and holding-period tracking tools are a whole category of software in their own right for active traders managing many lots of the same stock.
The 0% long-term bracket often surprises people who assume all investment gains are taxed. In years with modest other income, a retiree or someone taking a career break can realize a meaningful long-term gain and owe no federal tax on it at all, simply because their total taxable income stays under the 0% bracket threshold for their filing status -- a strategy sometimes called "tax-gain harvesting."