The quick answer

The tool's default run: a $25,000 gain held 500 days over $60,000 of other income, single filer, NIIT on, owes $3,750 federal at the 15% long-term rate, $0 NIIT. Sell the same gain 300 days in and the short-term estimate reads $8,000 at a flat 32%. Inputs are the gain, the holding days, your other income, filing status, and an NIIT switch. An estimate, not tax advice.

The tax bill that depends on a calendar

Same stock, same purchase price, same sale price, same $30,000 gain. Sold on a Tuesday in March it is a short-term gain taxed like a bonus check. Sold on a Thursday the following month, thirteen months after buying, it is a long-term gain taxed at a rate that can be less than half. Nothing about the investment changed. The calendar did.

This calculator takes the gain itself, the holding period in days, your other taxable income, your filing status, and an NIIT switch, and produces a federal estimate with the classification named and the rate shown. It is an educational estimate, not tax advice, and it says so on the page more than once.

Estimating your bill in five entries

The workflow mirrors how a sale actually unfolds: the gain first (which means you or your broker worked out proceeds minus basis), then the holding period, then your other income, then filing status, then the NIIT decision. Five entries, one federal estimate, 2026 thresholds.

  1. Enter the capital gain itself

    The first field takes the gain, which is proceeds minus adjusted basis. Basis is what you paid plus reinvested dividends, the piece people forget most; if you only know proceeds and purchase price, work the subtraction first, because the tool does not ask for the two separately.

  2. Set the holding period in days

    Trade date to trade date. The tool routes the gain to the long-term 0/15/20 schedule once holding exceeds 365 days; at 365 or fewer it uses the short-term track, a flat 32% mid estimate with the honest label that ordinary brackets run 24% to 37%.

  3. Add your other taxable income

    Capital gains stack on top of ordinary income, so the same gain taxes differently for a retiree with $30,000 of income and an engineer with $150,000. Leave this field at zero and the bracket lookup quietly cheats in your favor.

  4. Pick your filing status

    Single or married filing jointly. The tool doubles the single thresholds for joint filers, so the 0% band for a married couple runs to about $98,900 and the 15% ceiling to about $1,091,050. That doubling is an approximation the bracket table below explains.

  5. Switch NIIT on or off

    The 3.8% net investment income tax layer has its own toggle, on by default. With it on, the tool charges 3.8% on the whole gain once income plus gain crosses $200,000 single or $250,000 married, a simplification of the real lesser-of rule.

The results appear as three cards, estimated federal tax, rate applied, and the NIIT amount, with the classification underneath and a total-with-NIIT line. Everything recomputes as you type.

Short-term, long-term, and the 3.8% surtax

Two tax systems share one sale, and which one you meet depends on a single date comparison. Short-term gains, held one year or less, join your wages and interest as ordinary income and climb the regular brackets, 10% to 37%. Long-term gains, held more than one year, get their own schedule that ignores ordinary brackets entirely: 0%, 15%, or 20%.

Long-term rateSingle, taxable income (approx. 2026)Married filing jointly, as this tool computes it
0%up to $49,450up to $98,900
15%$49,450 to $545,500$98,900 to $1,091,050
20%above $545,500above $1,091,050
Single thresholds from Rev. Proc. 2025-32. The joint column is the tool's own computation: it doubles the single figures, and the IRS's actual joint ceiling for the 15% band is far lower than double (2025 sat at $600,050 against $533,400 single), so verify current-year figures before filing. These bands apply to taxable income including the gain itself.

The brackets move every year. The 2025 breakpoints sat at $48,350 single and $96,700 married filing jointly for the top of the 0% band, and $533,400 and $600,050 for the top of the 15% band, so the 2026 revision lifted each line by a few thousand dollars. The IRS republishes the figures every autumn in an inflation-adjustment revenue procedure, and irs.gov carries the current one, which outranks this table and every calculator built on it. The NIIT thresholds are the deliberate exception: $200,000 and $250,000 have not moved since 2013 and are not indexed to inflation, so the 3.8% layer quietly reaches a little further down the income ladder every year.

The stacking rule is where estimates usually go wrong. Long-term gains fill the 0% and 15% bands after your ordinary income has already filled them. A retiree with $30,000 of ordinary income and a $40,000 gain has $19,450 of that gain riding in the 0% band and the rest at 15%, for a real IRS bill of $3,082.50. A worker with $60,000 of income and the same gain gets zero benefit from the 0% band, so the entire gain is 15% and the bill is $6,000. Same gain, very different bills, and both are correct.

Here is the tool's honest limit on exactly that example: it looks up the bracket for income plus gain ($70,000 for the retiree) and applies that rate, 15%, to the whole gain, so its card reads $6,000 where the stacked IRS bill is $3,082.50. The single-rate shortcut errs high whenever income plus gain crosses a bracket inside the gain. Near a boundary, the hand-worked stacking arithmetic in this section is the number to trust, and the tool is the fast first pass.

The 3.8% net investment income tax layers on top for higher earners: it applies to the lesser of net investment income or the excess of modified AGI over $200,000 single / $250,000 married filing jointly. Those thresholds are statutory and never inflation-adjusted. NIIT stacks after the regular capital gains rate, so a 15% gain for a high earner becomes effectively 18.8%. The tool's version is a simplification: once income plus gain crosses the threshold it charges 3.8% on the entire gain, so just over the line its NIIT reads high (a couple at $260,000 of MAGI with a $30,000 gain really owes 3.8% on $10,000, which is $380, while the tool's card would show 3.8% on the full $30,000).

Four runs of the actual tool

Numbers make the machinery concrete. Four runs of the tool as it actually computes, all reproducible in the five entry fields.

The default run: long-term, mid income

Input

Capital gain: $25,000 · Holding period: 500 days · Other taxable income: $60,000 · Filing: single · NIIT: on

Output

Classification: Long-term 15% bracket
Estimated federal tax: $3,750
Rate applied: 15%
NIIT: $0 (income plus gain, $85,000, is under $200,000)
Total: $3,750
The same gain sold short-term

Input

Capital gain: $25,000 · Holding period: 300 days · Other taxable income: $60,000 · Filing: single · NIIT: on

Output

Classification: Short-term (ordinary, est. 24–37% by bracket, 32% shown as mid estimate)
Estimated federal tax: $8,000
Rate applied: 32%
NIIT: $0
A married couple in the 0% band

Input

Capital gain: $25,000 · Holding period: 500 days · Other taxable income: $40,000 · Filing: married joint · NIIT: on

Output

Classification: Long-term 0% bracket
Estimated federal tax: $0
Rate applied: 0%
NIIT: $0
Note: income plus gain of $65,000 sits under the doubled $98,900 joint threshold
A high earner with the NIIT layer

Input

Capital gain: $50,000 · Holding period: 400 days · Other taxable income: $200,000 · Filing: single · NIIT: on

Output

Classification: Long-term 15% bracket
Estimated federal tax: $7,500
Rate applied: 15%
NIIT (3.8%): $1,900 (on the whole gain, the tool's simplification)
Total with NIIT: $9,400

The second run is the one to read twice. Sold at 300 days the same $25,000 gain costs $8,000 on the tool's 32% mid estimate, against $3,750 long-term: waiting past the year mark saves about $4,250 on this trade, and the label honestly says ordinary brackets run 24% to 37%.

The third run shows the 0% band working in the tool's doubled-threshold world: a married couple with $40,000 of other income and a $25,000 long-term gain reads $0 federal, and under real IRS stacking the bill is also $0 because income plus gain stays under $98,900. The tool and the Code diverge when other income lands inside a bracket under the gain.

The home sale: the exclusion, worked three ways

The primary-residence exclusion is the most generous clause in the capital gains code, and its arithmetic is short enough to check by hand. A couple buys a home for $320,000, spends $28,000 on capital improvements over the years (the new roof and the addition, not the paint), and sells for $820,000 with $38,000 of realtor fees and closing costs. Adjusted basis is $348,000, and the realized gain is $434,000. This tool has no property mode, so the exclusion is a hand-worked example rather than a button.

Filing situationExclusion appliesTaxable gainFederal tax at 15%
Married filing jointly, both meet the 2-of-5-year test$500,000$0$0
Single owner meeting the test$250,000$184,000$27,600
Couple moved for a job after 18 months in the home$375,000 prorated (500,000 × 18/24)$59,000$8,850
Same $434,000 gain; the ownership-and-use tests and a proration formula decide the bill

Three rules produce that spread. The full exclusion requires owning and using the home as a primary residence for two of the five years before the sale; weekends at a cabin do not count, and a rental period erodes the use test. Filing status sets the size: $250,000 per qualifying owner, $500,000 for a married couple who both qualify. An early move for work, health, or unforeseen circumstances earns a prorated exclusion, months of qualifying use divided by 24 times the full amount, which is the row that saves relocations from punishing tax surprises.

Two practical notes the table hides. The exclusion is not once per lifetime; it is once per two years. And improvements raise basis rather than the exclusion, which is why the receipt file for a $28,000 roof is worth real money at sale time: without documentation, that money reappears as taxable gain.

Same $50,000 gain, four filing situations

A fixed $50,000 long-term gain under four situations, worked by hand with real IRS stacking. The first row is the one people refuse to believe: in a low-income year, five figures of long-term gains can clear at 0% federal.

SituationHand-worked IRS tax on the gainEffective rate on $50,000
Single, $30,000 other income0% on $19,450 + 15% on $30,550 = $4,582.509.2%
Single, $60,000 other income$7,500 at 15%15.0%
Married, $260,000 MAGI$7,500 + $380 NIIT = $7,88015.8%
Single, $60,000 income, sold at 11 months (22% bracket)$11,000 as ordinary income22.0%
Illustrative federal figures using approximate 2026 thresholds; state tax excluded. This tool's single-rate shortcut would read the first row as $7,500 (15% on the whole gain) and the last row as $16,000 (its flat 32% estimate), so near bracket edges the stacked hand math is the number to trust.

Read the first row again: a low-income year can make long-term gains genuinely free. Retirees between jobs, sabbaticals, a year of large deductions, all can push ordinary income low enough that five figures of gains clear at 0%. Sophisticated investors plan sales around exactly this, harvesting gains into the 0% band to reset basis upward at no federal cost, and executed annually across a retirement's low years the maneuver can move six figures of gains through the band without a bill.

A December harvesting session, netted line by line

Tax-loss harvesting is the offsetting rules run with intent, and the netting order does half the work. Consider a December portfolio: two long-term winners up $42,000 combined, one short-term winner up $8,000, and three losers ($26,000 long-term plus $9,000 short-term) that the owner is content to exit.

Ledger lineWithout harvestingWith harvesting
Short-term gains$8,000 taxed at 22%$0, fully absorbed by the $9,000 short-term loss
Long-term gains$42,000 taxed at 15%$15,000 taxable after $27,000 of losses absorb the rest
Federal tax on the year's trading$8,060$2,250
Net loss carried to ordinary income$0$0, losses were fully used against gains
Savings$5,810 federal, before any state benefit
The $9,000 short-term loss first erases the $8,000 short-term gain, then its $1,000 remainder crosses into the long-term column

The order of operations is what makes the savings bigger than intuition suggests. Short-term losses land against short-term gains first, the 22%-taxed column, before touching the cheaper long-term column, so the worst-taxed gains disappear first. Had the netting run the other direction, the same losses would have eaten 15%-taxed gains and left $8,000 of short-term gain standing at full rate.

The wash-sale rule is the one trap in the maneuver: repurchasing the same or substantially identical security within 30 days before or after the loss sale disqualifies the loss, which defers into the new position's basis instead of vanishing, and an IRA repurchase voids it outright. The standard clean workaround is selling one fund and buying a similar-but-not-identical index tracking the same market slice, holding both for 31 days, then rebalancing. Harvesting also resets the cost basis of any replacement upward, which converts today's savings into a slightly larger future gain.

Five mistakes that inflate capital gains estimates

Marginal ordinary rateShort-term cost per $10,000 of gainLong-term cost at 15%The 366-day dividend
22%$2,200$1,500$700
24%$2,400$1,500$900
32%$3,200$1,500$1,700
35%$3,500$1,500$2,000
37%$3,700$1,500$2,200
What selling one day short of long-term treatment costs, per $10,000 of gain, at five ordinary brackets
  • Selling on the anniversary. The holding period starts the day after the purchase trade date, so a sale exactly 365 days later is still short-term, and the table above is what the forgotten day costs. This tool's own cutoff is days above 365, which matches.
  • Taxing proceeds instead of gain. The bill runs on sale price minus basis. A $100,000 sale of stock bought at $95,000 owes 15% of $5,000, which is $750, not 15% of $100,000.
  • Forgetting reinvested dividends. Every DRIP purchase since the first lot is a basis addition; estimating from the original purchase alone overstates the gain, sometimes by thousands on a long-held position.
  • Buying a fund days before its distribution. A December purchase means paying tax on a capital-gains distribution that largely returns your own money, and the NAV drops by the distribution on the ex-date regardless.
  • Ignoring the state layer. California taxes gains as ordinary income, up to 13.3% on top of the federal bill, while nine states levy no income tax at all. The same sale relocates thousands of dollars depending on the address on the return, and this tool prices none of it.

Every item on the list is a planning input, not a filing emergency: the day-after rule is checkable before the trade, and the basis is checkable in the broker's cost-basis report.

What this estimate leaves out

The disclaimer deserves its own prominent line: the output is a planning estimate built on 2026 federal thresholds, not tax advice and not a filing figure. The seams are named plainly below:

  • State and local tax. There is no state input at all; the tool's note says state taxes are extra and not included. Real state regimes vary from zero to double digits. Filing-grade state math needs your actual return.
  • Bracket stacking. The tool applies one rate to the whole gain; the IRS stacks the gain across the 0% and 15% bands, so near a bracket boundary the tool reads high.
  • NIIT precision. The real surtax is 3.8% of the lesser of net investment income or the MAGI excess; the tool charges 3.8% on the whole gain once over the threshold.
  • Threshold rounding. The internal brackets carry the 2026 figures from Rev. Proc. 2025-32, doubled for joint filers rather than taken from the IRS's actual married ceilings. Treat this tool as sizing, not filing.
  • Everything behavioral. Loss carryovers from prior years, wash-sale adjustments, gifted or inherited basis stepped up at death, collectibles at 28%, qualified small business stock exclusions: each has rules this tool does not attempt.
  • Estimated-tax consequences. A large gain can trigger estimated-payment obligations in the quarter it landed; the quarterly estimated tax calculator covers that cascade.
  • Property detail. Depreciation recapture, primary-home exclusions, installment sales: the tool takes a plain gain and has no property mode, so these reward a professional's hour.

A calculator that never phones home

Portfolio values, basis figures and income bands make a tidy financial portrait, exactly the kind of financial input that should never leave the device, and here it doesn't. The bracket logic is JavaScript running on your device; the numbers you enter exist for the duration of the calculation and then are gone. No account tier gates the NIIT toggle, and no server ever sees what your position is worth. Real tax planning is comparative, sell this year versus next, harvest now versus January, and a tool with zero friction is one you will actually rerun each time the question shifts.

Frequently asked questions

What is the difference between short-term and long-term capital gains tax?

The dividing line is one year of holding. Short-term gains, on assets held one year or less, are taxed as ordinary income at your regular bracket rate, from 10% up to 37%. Long-term gains get the preferential schedule of 0%, 15%, or 20%, with the 0% band covering the first $49,450 of taxable income for single filers in 2026 ($98,900 married filing jointly). On a $30,000 gain at a 24% ordinary rate, waiting past the one-year mark saves around $2,700.

What are the 2026 long-term capital gains brackets?

0% on taxable income up to $49,450 single or $98,900 married filing jointly; 15% up to $545,500 single or $613,700 joint; and 20% above that. These follow Rev. Proc. 2025-32, the IRS revenue procedure setting tax-year 2026 inflation adjustments. One tool note: this calculator doubles the single thresholds for joint filers, so its married 15% ceiling (about $1,091,050) runs higher than the IRS's actual joint figure, and married results near a bracket edge deserve a hand check.

When does the 3.8% net investment income tax apply?

NIIT applies to the lesser of your net investment income or the amount by which modified adjusted gross income exceeds $200,000 single or $250,000 married filing jointly, thresholds fixed by statute and not indexed for inflation. A couple with $260,000 of MAGI and $30,000 of gains owes 3.8% on only $10,000, which is $380, layered on top of the regular capital gains rate. This calculator simplifies that: once income plus gain crosses the threshold it charges 3.8% on the whole gain, so its NIIT line reads high when you are just over the line.

How is capital gain calculated on a property sale?

Gain equals sale price minus selling expenses minus adjusted basis, where adjusted basis is purchase price plus capital improvements minus depreciation taken. For rentals, the depreciation portion is 'unrecaptured Section 1250 gain' taxed at up to 25% rather than the usual long-term rates. Primary residences add the exclusion, $250,000 single and $500,000 married filing jointly, if ownership and use tests are met. Work these by hand or with a professional; this tool takes the gain itself, not property detail.

Does the calculator include state capital gains tax?

No, the estimate is federal only; the tool's note says state taxes are extra and not included. Most states tax gains as ordinary income, so a 5% state on a $40,000 gain adds $2,000 on the state return. Nine states levy no income tax at all.

Do I pay capital gains tax if I reinvest the proceeds?

In the US, selling a stock or fund for a gain is a taxable event whether or not you reinvest. There is no general reinvestment deferral outside specific vehicles like 1031 exchanges for investment real estate or Qualified Opportunity Funds. The 'reinvest and avoid tax' folklore comes from retirement accounts, where sales inside the wrapper genuinely do not trigger tax.

Can I offset gains with losses?

Yes, and the ordering matters. Losses first offset gains of the same kind, short against short and long against long, then cross over. Up to $3,000 of net capital loss additionally offsets ordinary income each year, with the remainder carrying forward indefinitely. December's tax-loss harvesting is this mechanic used deliberately, though the wash-sale rule blocks repurchasing the same security within 30 days.

Is this estimate official tax advice?

No. The calculator implements the 0/15/20% long-term schedule, a flat 32% mid estimate for short-term gains, and a 3.8% NIIT layer as an educational estimate carrying approximate Rev. Proc. 2025-32 thresholds. Filing decisions, especially around property sales and loss carryovers, belong with your own records and a tax professional.

Do I owe capital gains tax on inherited stocks or property?

Usually not on the gain that happened before you inherited. Stepped-up basis resets the asset's cost basis to its fair market value on the date of the original owner's death, so a stock bought at $20 that was worth $190 at inheritance carries a $190 basis for you: sell at $195 and your taxable gain is $5, not $175. Sell soon after inheriting and the gain can be nearly zero; hold for years and only the post-inheritance growth is taxed.

Why is my gold fund's long-term gain taxed at 28%?

Because of how it is structured. Physically backed gold ETFs are typically grantor trusts holding bullion, and the IRS treats precious metals as collectibles taxed at a maximum long-term rate of 28% rather than the usual 15% or 20%. A gold-mining stock fund holds equities and taxes normally; the difference sits entirely in the wrapper. The same 28% band covers coins, art, and wine.

What is the cost basis of property I received as a gift?

Gifts carry the donor's basis, with a twist for losses: the loss basis becomes the lesser of the donor's basis or the fair market value on the date of the gift. Sell above the donor's basis and the gain is measured from it; sell below the gift-date value and the loss is measured from that value instead; sell in between and the result is neither gain nor loss. Inherited property is the opposite regime: basis steps up to the date-of-death value, and appreciation during the deceased's lifetime never gets taxed.

Can I deliberately use the 0% long-term rate?

Yes, the band is real money in low-income years. Gains fill the 0% threshold only after ordinary income has used its share, so the workable amount equals the 0% cap minus your taxable ordinary income: with $20,000 of income against a $49,450 single cap, $29,450 of long-term gains clear federally each such year. Watch state treatment, since a state taxing gains as ordinary income can reclaim most of the federal zero, and remember realizing gains raises future basis, which lowers future bills in exchange.

Sources and further reading

Rate structure, NIIT rules, and 2026 thresholds follow the IRS primary documents:

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.