Capital Gains Tax Calculator Federal and State
Estimate your taxable capital gain, federal tax, state tax, and net after-tax proceeds using a premium interactive calculator. This tool is designed for stocks, funds, real estate, and other appreciated assets where basis, selling costs, holding period, filing status, and state tax treatment all matter.
Interactive Calculator
Enter your figures and click calculate to see federal and state capital gains tax estimates.
How a capital gains tax calculator federal and state estimate works
A capital gains tax calculator federal and state estimate helps you understand how much tax may be due when you sell an appreciated asset. The federal side of the calculation determines whether your gain is taxed at short-term ordinary income rates or at the lower long-term capital gains rates. The state side of the calculation estimates how your home state may tax the same gain. Some states impose no income tax at all, some tax capital gains at ordinary state income tax rates, and a few states have special rules or surtaxes that can materially change your result.
The core formula starts with your amount realized on sale. In plain language, that means your sale price minus eligible selling costs such as commissions and transaction fees. From there, you subtract your adjusted basis, which usually begins with the purchase price and may be increased by eligible improvements, reinvested amounts, or certain capitalized expenses. The difference is your capital gain. If the figure is negative, you have a capital loss instead of a gain.
Important: This calculator is an educational estimator, not tax advice. Real tax returns can involve depreciation recapture, wash sale rules, installment sales, home sale exclusions, carryforward losses, collectible rates, NIIT, and local surtaxes. For official rules, review IRS guidance and your state department of revenue.
Federal capital gains tax basics
Federal capital gains tax depends first on your holding period. If you held the asset for one year or less, the profit is generally a short-term capital gain. Short-term gains are taxed using the same progressive federal brackets that apply to ordinary income such as wages and interest. If you held the asset for more than one year, the gain is generally long-term. Long-term capital gains often qualify for the preferential federal rates of 0%, 15%, or 20%, depending on your taxable income and filing status.
This distinction is one of the most valuable planning tools available. For many taxpayers, simply waiting long enough to move a gain from short-term treatment to long-term treatment can reduce the federal tax cost dramatically. A calculator helps illustrate that difference before you sell, which can be useful for year-end planning, rebalancing a portfolio, or deciding whether to spread sales across multiple tax years.
2024 federal long-term capital gains thresholds
| Filing status | 0% rate up to | 15% rate up to | 20% rate above |
|---|---|---|---|
| Single | $47,025 | $518,900 | Over $518,900 |
| Married filing jointly | $94,050 | $583,750 | Over $583,750 |
| Married filing separately | $47,025 | $291,850 | Over $291,850 |
| Head of household | $63,000 | $551,350 | Over $551,350 |
The important nuance is that your long-term gain does not exist in a vacuum. It stacks on top of your other taxable income. For example, if a single filer already has taxable ordinary income of $85,000 before the sale, that taxpayer has already used the 0% long-term capital gains band. A calculator therefore has to look at both numbers together: your taxable income before the sale and the gain triggered by the sale itself.
Short-term gains can be expensive
Short-term gains are generally taxed as ordinary income, which means they follow federal marginal tax brackets. If your gain pushes part of your income into a higher marginal bracket, only the portion above the threshold is taxed at the higher rate. This is why an accurate calculator compares your tax before the gain to your tax after the gain, then measures the difference. That difference is a better estimate of the tax cost attributable to the sale.
State capital gains tax matters more than many investors expect
At the state level, the treatment of capital gains ranges from zero to relatively high effective rates. States such as Florida, Texas, Nevada, Washington state for most general scenarios, Alaska, South Dakota, Tennessee, and Wyoming are often associated with no broad state income tax on ordinary wage income. In contrast, states such as California, Oregon, Minnesota, New Jersey, and New York can create a much larger tax bite. In many high income scenarios, state tax can rival or exceed the difference between the federal 15% and 20% long-term brackets.
That is why a capital gains tax calculator federal and state estimate is more useful than a federal-only model. If you are comparing a move, planning a business exit, selling concentrated stock, or disposing of rental real estate, ignoring state tax can materially understate your total tax liability.
Illustrative state tax environment comparison
| State | General treatment of capital gains | Illustrative top or flat rate used in this estimator |
|---|---|---|
| California | Generally taxed as ordinary income | 9.30% |
| New York | Generally taxed as ordinary income | 6.85% |
| New Jersey | Generally taxed as ordinary income | 8.97% |
| Massachusetts | Flat income tax framework for many taxpayers | 5.00% |
| Pennsylvania | Flat income tax framework | 3.07% |
| Illinois | Flat income tax framework | 4.95% |
| Texas | No broad state income tax | 0.00% |
| Florida | No broad state income tax | 0.00% |
The percentages above are simplified planning assumptions used by this tool for quick estimation. They are not a substitute for a state-specific tax return calculation. Local taxes, high income surcharges, partial-year residency rules, sourcing rules, and entity-level taxes can all alter the actual amount due.
Inputs you should prepare before using the calculator
- Purchase price or cost basis: This is the amount you originally paid for the asset, usually including certain acquisition costs.
- Basis adjustments: For real estate, this may include qualifying improvements. For securities, this may include dividend reinvestment basis adjustments or certain broker-reported adjustments.
- Sale price: The gross amount you received from the buyer.
- Selling costs: Commissions, escrow fees, legal fees, broker costs, or similar direct selling expenses.
- Holding period: Whether the asset was held for more than one year or not.
- Taxable ordinary income: Your expected taxable income before this gain, which determines where the gain lands in the federal rate structure.
- State of residence or tax exposure: State rules can meaningfully change your total effective rate.
Common situations where estimates can differ from reality
1. Sale of a primary home
Many home sellers qualify for a federal home sale exclusion if ownership and use tests are met. Because this page is a general capital gains tax calculator federal and state estimator, it does not automatically apply the Section 121 exclusion. If you are selling a primary residence, your taxable gain may be much lower than the raw gain shown here.
2. Rental property or depreciable real estate
Real estate can trigger depreciation recapture, which is not the same as ordinary long-term capital gains tax. A simple calculator cannot fully model every recapture layer, passive loss rule, or like-kind exchange issue. Treat the result as a planning estimate only.
3. Collectibles and special categories
Some assets, such as certain collectibles, can face different maximum federal rates. Qualified small business stock, business exits, and installment sales may also require separate handling. This calculator is intentionally streamlined to keep the estimate understandable and useful for broad planning.
4. Net investment income tax
Higher-income households may owe an additional federal net investment income tax. Because thresholds and interactions can vary, sophisticated planning may require a fuller model beyond a baseline calculator.
How to use the estimate for tax planning
- Test timing: Compare selling now versus waiting until the gain becomes long-term.
- Spread gains across years: Large sales may produce a lower effective rate if divided into multiple tax years.
- Harvest losses: Capital losses can offset gains, reducing your taxable amount.
- Check residency exposure: If you expect to move, state tax differences can be significant.
- Adjust estimated tax payments: If a large sale is likely, consider whether quarterly payments may be needed.
What the calculator on this page is doing
This calculator first computes your estimated gain using sale price minus selling costs minus adjusted basis. If the holding period is long-term, it applies the 2024 federal long-term capital gains thresholds by filing status and layers your gain on top of your ordinary taxable income. If the holding period is short-term, it calculates the extra federal tax by comparing ordinary income tax before and after the gain. Then it adds an estimated state tax based on the state selected. Finally, it shows your after-tax proceeds and a chart that visualizes the relationship among sale value, basis, gain, federal tax, state tax, and estimated net cash after taxes.
Because planning estimates are only as good as the inputs used, accuracy improves when you have your actual adjusted basis and realistic selling costs. If you are working with property, inherited assets, gifted assets, restricted stock, or a business sale, a CPA or tax attorney can help verify basis and identify rules that a general estimator cannot automatically apply.
Authoritative sources for official rules
For official federal tax information, review the IRS Topic No. 409 on capital gains and losses and the IRS federal income tax rates and brackets page. For legal reference materials and federal tax code context, Cornell Law School provides the U.S. Code Title 26 tax law resource. Always confirm current-year thresholds and state treatment before filing.
Bottom line
A high-quality capital gains tax calculator federal and state estimate helps you make better decisions before a sale happens. It can show whether the gain is likely to fall into the 0%, 15%, or 20% federal long-term rate bands, whether a short-term sale could create a substantially larger tax bill, and how much state tax may change your total result. Use the calculator above as a planning tool, then validate the final numbers with official guidance or a qualified tax professional when the transaction is material.