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's a short-term gain taxed like a bonus check. Sold on a Thursday the following month — thirteen months after buying — it's a long-term gain taxed at a rate that can be less than half. Nothing about the investment changed. The calendar did.

That cliff at the one-year mark is the single most useful fact in retail investing, and yet the surrounding mechanics stay murky: which bracket the gain lands in, whether the 3.8% surtax layers on top, what your state takes, and what happens when the asset is a rental property with fifteen years of depreciation baked into its basis. People guess at all of it, and guessing in either direction costs money — overpaying from ignorance, or under-reserving and meeting an April surprise.

This calculator takes the sale — proceeds, basis, holding period, your other income — and produces a federal estimate with the bracket logic done correctly, the NIIT layered where it belongs, and an optional state add-on. Property mode handles depreciation recapture for rental sales. It is an educational estimate, not tax advice, and it says so more than once. It runs in your browser, asks for nothing but numbers, and explains every line it produces.

Estimating your gain in five entries

The workflow tracks how a sale actually unfolds:

  1. Enter proceeds and cost basis

    Proceeds are what you realized, net of commissions. Basis is what you paid plus reinvested dividends — the piece people forget most, and forgetting it overstates the gain.

  2. Set the holding period

    Trade date to trade date. The calculator routes the gain to the short-term ordinary-rate track or the long-term 0/15/20 schedule based on whether the year mark was crossed.

  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. This field is what makes the estimate honest.

  4. Choose federal-only or add a state rate

    Federal-only keeps the answer clean; a flat state percentage approximates the state layer for sizing purposes. Most states simply treat gains as income.

  5. Switch to property mode if it's real estate

    For rentals, enter depreciation taken and the calculator splits the gain into unrecaptured Section 1250 gain — taxed at up to 25% — and the remainder at long-term rates.

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 (approx. 2026)
0%up to $49,450up to $98,900
15%$49,450 to $545,500$98,900 to $613,700
20%above $545,500above $613,700
2026 thresholds from Rev. Proc. 2025-32, the IRS inflation-adjustment revenue procedure; verify against the current revision before filing. These bands apply to taxable income including the gain itself.

The brackets move every year, which is worth internalizing before memorizing any of them. 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 roughly one to fourteen thousand dollars depending on the breakpoint and filing status. The IRS republishes the figures every autumn in an inflation-adjustment revenue procedure — irs.gov carries the current one, and it 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 the surtax took effect in 2013 and are not indexed to inflation, so the 3.8% layer quietly reaches a little further down the income ladder every single year.

The stacking rule is where estimates usually go wrong. Long-term gains don't get their own bracket in isolation — they 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%. A worker with $60,000 of income and the same gain gets zero benefit from the 0% band — ordinary income already sits above $49,450, so the entire gain is 15%. Same gain, very different bills, and both are correct.

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, so they creep down in real terms every year. NIIT stacks after the regular capital gains rate — a 15% gain for a high earner becomes effectively 18.8%.

Property mode exists because real estate is not stock. Sell a rental and the gain splits into two parts: the depreciation you took over the years of ownership — unrecaptured Section 1250 gain, taxed at up to 25% — and everything else, taxed at the normal long-term schedule. A primary residence gets better treatment still: the first $250,000 of gain ($500,000 married filing jointly) is excluded outright if you owned and used it as your main home for two of the last five years. Crypto, for the record, is property too — every trade is a taxable event, a fact the crypto profit calculator keeps in view on its side of the street.

Three sales, three very different bills

Numbers make the stacking rule concrete. Three taxpayers, all selling appreciated assets in 2026, all single, no state tax for clarity.

The retiree — $40,000 long-term gain on $30,000 of income

Input

Ordinary taxable income: $30,000 · Gain: $40,000, held 3 years · Filing status: single

Output

0% band used by ordinary income: $30,000
0% band remaining for gains: 49,450 − 30,000 = $19,450 taxed at 0% = $0
15% portion: 40,000 − 19,450 = $20,550 × 15% = $3,082.50
NIIT: MAGI $70,000 is below $200,000 — none
Total federal tax on the gain: $3,082.50
The employee — same $40,000 gain on $60,000 of income

Input

Ordinary taxable income: $60,000 · Gain: $40,000, held 3 years · Filing status: single

Output

Ordinary income already exceeds the $49,450 0% threshold
Entire gain falls in the 15% band: 40,000 × 15% = $6,000
NIIT: MAGI $100,000 — below $200,000, none
Total federal tax on the gain: $6,000
The one-year miss — short-term version of the same trade

Input

Ordinary taxable income: $60,000 · Gain: $40,000, sold at 11 months · Marginal ordinary rate: 22%

Output

Short-term gain joins ordinary income: 40,000 × 22% = $8,800
Versus the long-term bill of $6,000
Cost of selling 41 days early: $2,800

Same gain, three answers: $3,082.50, $6,000, and $8,800. The spread is nearly 3x on identical economics, which is why 'how much will I owe?' has no answer without your other income and the trade date. The NIIT example completes the picture: a married couple with $260,000 of MAGI and a $30,000 long-term gain pays 15% on the gain — $4,500 — plus 3.8% on the lesser of $30,000 or the $10,000 over the $250,000 threshold: another $380, for $4,880 total.

Property mode — the rental sold after 15 years

Input

Purchase price: $280,000 ($180,000 allocated to building) · Depreciation taken: $52,000 · Sale price: $400,000 · Filing status: married filing jointly, other income already above all thresholds

Output

Adjusted basis: 280,000 − 52,000 = $228,000
Total gain: 400,000 − 228,000 = $172,000
Unrecaptured §1250 gain: 52,000 × 25% = $13,000
Remaining long-term gain: 120,000 × 15% = $18,000
Federal total before NIIT: $31,000

The rental surprise is always the depreciation: sellers expect one number and the recapture portion bills at up to 25%, a rate higher than the 15% they planned around. Selling expenses and capital improvements reduce the gain — a new roof added to basis years ago is worth remembering now, and the calculator's property mode accepts it in the basis field.

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, the addition, not the paint — and sells for $820,000 with $38,000 of realtor fees and closing costs. Adjusted basis is 320,000 + 28,000 = $348,000, and the realized gain is 820,000 − 348,000 − 38,000 = $434,000.

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, with a surviving spouse generally retaining the full amount for two years after the other spouse's death. And an early move for work, health, or unforeseen circumstances earns a prorated exclusion — months of qualifying use divided by 24, times the full amount — rather than none at all, 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, so serial homeowners can use it repeatedly across a lifetime of appreciating houses. 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

One more way to see the machinery — a fixed $50,000 long-term gain under four situations, everything else varied:

SituationTax 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. The same economic gain spans 9.2% to 22% depending on timing and total income.

Read the first row again, because it is the one people refuse to believe: 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.

The 0% band also works as a deliberate harvest window when a low-income year arrives. Take the $60,000 earner forced into a sabbatical year with $20,000 of ordinary taxable income: the 0% band then stretches over $29,450 of long-term gains, so realizing exactly that much of an appreciated position costs zero federal tax, pushing the remainder into next year's planning. Executed annually across a retirement's low years, the maneuver can move six figures of gains through the 0% 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 of long-term losses plus $9,000 of short-term losses — 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 — 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 if the original is missed. Harvesting also resets the cost basis of any replacement upward, which converts today's savings into a slightly larger future gain — genuinely beneficial, mildly less magical than the first number implies.

Five mistakes that inflate capital gains estimates

The same five errors account for most of the wrong estimates we see — and most of the unpleasant Aprils. First, the price of the most common one, priced per bracket:

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 — long-term treatment needs a year plus a day, and the table above is what the forgotten day costs.
  • 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 — $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.

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

What this estimate leaves out

The seams, named plainly:

  • State and local detail. The optional state layer is a flat approximation. Real state regimes vary from zero to double digits, a few use flat rates on gains, and local surtaxes exist. Filing-grade state math needs your actual return.
  • Threshold rounding. The internal brackets carry the 2026 figures from Rev. Proc. 2025-32; that revenue procedure and its successors are the authoritative numbers. 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.
  • Advice, explicitly. This is an educational estimate. Property sales in particular — depreciation recapture, primary-home exclusions, installment sales — reward a professional's hour.

Investors and sellers who lean on this

December brings the tax-loss-harvest crowd — pairing losers against the year's gains and checking whether waiting three weeks pushes a short-term winner across the one-year line. January through April brings the filing crowd, reconstructing what a February sale actually cost them. Between those poles, the regulars are methodical: rebalancers sizing a position trim, retirees planning annual gain harvesting inside the 0% band, and employees watching vested RSUs decide whether this year's income leaves room for the 15% band or grazes the NIIT threshold.

Property mode has its own calendar. Landlords weighing a sale run the depreciation-recapture number before listing, because the 25% slice changes the walk-away price. Families selling a long-held home check whether the $250,000/$500,000 exclusion absorbs the whole gain or just most of it. Crypto holders — every swap a taxable event — run gain estimates continuously, and the natural pairing there is the crypto profit calculator, which handles the position math this tool's inputs expect.

Investors tracking what compounding actually delivers pair this page with the compound interest calculator and the ROI calculator — pre-tax growth on one side, after-tax reality on the other. The difference between those two numbers is the quiet cost most projections ignore.

A calculator that never phones home

Portfolio values, basis figures, and income bands make a tidy financial portrait, and this tool refuses to ship one anywhere. The bracket tables and stacking logic are 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 layer. No email address buys the property mode.

The bonus is iteration speed. Real tax planning is comparative — sell this year versus next, harvest now versus January, take the gain in the 0% band versus let it ride — and a tool with zero friction and zero surveillance is one you will actually rerun each time the question shifts.

Capital gains questions, answered

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

The dividing line is one year of holding, measured from trade date to trade date. Short-term gains — 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 are the official figures from Rev. Proc. 2025-32, the IRS revenue procedure setting tax-year 2026 inflation adjustments — worth re-checking against the current revision before filing in case Congress revisits thresholds.

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.

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, $500,000 married filing jointly — on gains above the adjusted basis if ownership and use tests are met.

Does the calculator include state capital gains tax?

There is an optional state layer you can switch on. Most states tax gains as ordinary income — a 5% state on a $40,000 gain adds $2,000. Nine states levy no income tax at all, and a few tax gains at flat rates regardless of brackets. The state figure is a flat-rate approximation for sizing, not a filing-grade number for every locality.

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, 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 published rate structure — 0/15/20% long-term schedule, ordinary rates for short-term, the 3.8% NIIT layer, depreciation recapture for property — as an educational estimate carrying the 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. The estate-tax system, not the income-tax system, is where large estates settle their bills. 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 interests in collectibles — which include precious metals — as collectible gains 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, wine, and most tangible collectible assets held over a year.

What counts toward the two-of-five-years home test?

Months in which the home was your principal residence — where your bills, license, and life actually operated. Ownership and use are separate tests that must each be satisfied for 24 of the 60 months before the sale, though the months need not be contiguous. Short absences count as use; a two-year rental stretch does not, and a home-office fraction allocates business-use square footage out of the exclusion. Married couples need each spouse to pass the use test individually to claim the full $500,000.

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

Gifts carry the donor's basis — the carryover — 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 entirely: basis steps up to the date-of-death value, and the appreciation during the deceased's lifetime never gets taxed. The two paths produce wildly different bills on identical assets.

Can I choose which tax lots to sell?

Yes, and the default is not your friend. Brokers default to FIFO — first in, first out — which sells the oldest, usually lowest-basis lots and maximizes the gain. Specific identification lets you name the lots at the time of the sale, so selling the highest-basis lots first minimizes the bill; most brokerages now require a standing instruction before the trade settles rather than a phone call afterward. Check the setting before a large sale, not after.

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 — 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.

Where to go next

Gain estimates rarely stand alone. The crypto profit calculator does the position-level work — average entry, fees, break-even — whose output becomes this tool's inputs; the compound interest calculator shows what the untaxed version of the same portfolio does; and the ROI calculator frames the whole holding as a rate of return before the tax slice comes off the top.

Sources

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.