How to Use the Capital Gains Tax Calculator (Worked Examples)
Six worked scenarios with real inputs and results: a middle-bracket sale, 0 percent bracket harvesting, a short-term shock, NIIT, a home sale, and wash-sale netting.
Reading the rules is one thing; watching them produce a number is another. This companion to our capital gains tax calculator works through six realistic scenarios with actual 2025 figures, showing the inputs, the arithmetic, and the result each time. The cases are built to be checked by hand โ every rate and threshold quoted comes from published IRS parameters for 2025 โ and the logic transfers to 2026, where the brackets are a few thousand dollars wider. Treat each result as an educational estimate for planning, not a filed return, and remember that state tax sits on top in most states.
CHAPTER 01Before You Start: The Inputs That Drive Everything
Every scenario starts with the same three inputs: cost basis (what you paid, plus improvements and reinvested dividends), sale proceeds (price minus selling costs), and the holding period (more than one year means long-term). The fourth input is the one people forget: your taxable income from everything else. Capital gains tiers stack on top of your other income, so the calculator needs your salary, retirement withdrawals, and other gains to place each dollar of the gain in the right tier.
Before starting, pull your 1099-B forms if a broker handled the sale โ they list proceeds and often basis. For property, dig out settlement statements and improvement receipts. Enter the numbers, set the filing status and year, and read two outputs: the tax on the gain and the after-tax proceeds. If the tool asks for your marginal bracket, it is usually preparing the short-term comparison, because short-term gains are taxed as ordinary income at 10 to 37 percent for 2025-2026.
CHAPTER 02Scenario 1 โ A Long-Term Gain in a Middle Bracket
Maya is single, in 2025, with a 95,000-dollar salary. She takes the 15,000-dollar standard deduction, so her taxable income before gains is 80,000 dollars. In March she sells a fund bought three years ago: proceeds of 32,000 dollars against a 20,000-dollar basis, for a 12,000-dollar long-term gain. She enters salary, filing status, basis, proceeds, and purchase date, and the calculator returns a federal tax of 1,800 dollars on the gain.
Why 15 percent: her 92,000 dollars of taxable income is above the 48,350-dollar ceiling of the 0 percent tier for single filers in 2025, so the whole gain sits in the 15 percent band. Twelve thousand dollars times 0.15 equals 1,800. Her modified adjusted gross income of roughly 107,000 dollars stays under the 200,000 NIIT threshold, so the 3.8 percent surtax adds nothing.
The comparison worth knowing: if she had sold at eight months, the gain would be short-term and taxed at her 22 percent marginal rate โ 2,640 dollars, an extra 840 for no reason other than impatience. One more note: her state taxes gains as ordinary income, so a state-level bill arrives on top; the calculator's federal figure never includes that.
CHAPTER 03Scenario 2 โ Harvesting the 0 Percent Bracket in Retirement
Robert is 68, single, and retired in 2025, living on a pension and modest IRA withdrawals that produce 45,000 dollars of income. After the 15,000-dollar standard deduction his taxable income is 30,000. He holds a brokerage position with a 25,000-dollar embedded long-term gain and wants to know what a full sale would cost. The calculator shows something remarkable: most of the gain can be realized at a 0 percent federal rate.
The 0 percent bracket for single filers reaches 48,350 dollars of taxable income in 2025. Robert's 30,000 leaves 18,350 dollars of room. Enter the full sale: the first 18,350 dollars of the gain is taxed at 0 percent, and the remaining 6,650 is taxed at 15 percent, which is 997.50 โ call it 998 dollars on a 25,000-dollar gain. His total taxable income rises to 55,000, still far below the NIIT line.
Two cautions keep this honest. First, filling the 0 percent bracket to the brim can raise Medicare premium surcharges in later years for higher-income retirees; Robert's income is well below those lines, but not everyone's is. Second, state treatment differs โ some states tax the whole gain regardless. The calculator's figure is federal and educational, and a planner can confirm the premium side effects.
CHAPTER 04Scenario 3 โ A Short-Term Gain Stacked on Salary
Priya is single in 2025 with taxable income of 95,000 dollars from salary, and she must sell company stock that vested weeks ago. The sale produces a 15,000-dollar short-term gain. She enters the numbers, and the calculator stacks the gain on her salary: taxable income becomes 110,000 dollars.
Short-term gains are taxed as ordinary income. The 22 percent bracket for single filers in 2025 runs from 48,475 to 103,350 dollars, and 24 percent starts above that. So the gain splits: 8,350 dollars at 22 percent (1,837.00) plus 6,650 at 24 percent (1,596.00), for a total of 3,433 dollars. Stacking matters โ a naive tool applying 22 percent to everything would understate the bill by about 759 dollars.
Had the same shares been long-term, the entire 15,000-dollar gain would sit at 15 percent โ 2,250 dollars. The difference of 1,183 is the price of a short holding period. Employees with vesting schedules can sometimes influence sale timing, and the calculator's short-term versus long-term toggle shows exactly what the calendar is worth before deciding.
CHAPTER 05Scenario 4 โ Crossing the NIIT Line as a Married Couple
Jordan and Sam file jointly in 2025 with combined salaries of 210,000 dollars. They sell a stock position for a 60,000-dollar long-term gain. The calculator first applies the 15 percent tier โ their 270,000-dollar MAGI is below the 600,050 joint ceiling โ producing 9,000 dollars of bracket tax. Then it checks the net investment income tax: MAGI of 270,000 exceeds the 250,000 joint threshold by 20,000, and the surtax applies to the lesser of net investment income (60,000) or that excess (20,000).
So NIIT is 20,000 dollars times 3.8 percent, or 760, bringing the federal total to roughly 9,760. The lesson is that NIIT is an income-line problem, not a gain-size problem: a smaller gain on top of lower salaries might owe nothing, while this mid-size gain crosses the line. Timing a sale into a year with lower wages โ a sabbatical, early retirement โ is the classic mitigation, and the calculator makes the cross-year comparison painless.
CHAPTER 06Scenario 5 โ Selling a Home With the Section 121 Exclusion
A married couple sells the house they have owned and occupied since 2018. Purchase price 320,000 dollars; kitchen and bath renovations of 40,000 raise basis to 360,000. Sale price 720,000 dollars, with 30,000 in agent and closing costs, so the amount realized is 690,000. The gain is 690,000 minus 360,000, or 330,000 dollars.
Section 121 excludes up to 500,000 dollars of gain for married joint filers who owned and used the home as a main residence for two of the last five years. The calculator applies the exclusion and returns 0 dollars of federal capital gains tax. A single filer in the identical situation would be capped at 250,000 and owe 15 percent on 80,000 โ 12,000 dollars โ which is why the same house sale produces very different outcomes for different owners. Rentals and second homes do not qualify for the full exclusion.
CHAPTER 07Scenario 6 โ Losses, Wash Sales, and Netting
Netting is where hand math usually fails. In 2025 an investor closes three positions: stock A at a 4,000-dollar long-term loss, fund B at a 9,000-dollar long-term gain, and option C at a 2,000-dollar short-term loss. The calculator nets long-term first (9,000 gain minus 4,000 loss equals a 5,000-dollar net long-term gain), then short-term (a 2,000-dollar net loss), and combines them into a single 3,000-dollar net long-term gain โ taxed at 15 percent for a middle-bracket filer, about 450 dollars.
Now the wash-sale rule. If the investor repurchases stock A within 30 days of the loss sale, the 4,000-dollar loss is disallowed for now and added to the basis of the new shares. The calculator cannot see future trades, so the honesty rule is: run the numbers before year-end tax-loss harvesting, then actually stay out of the repurchase window.
If losses exceed gains, up to 3,000 dollars of the excess offsets ordinary income each year and the rest carries forward. A trader with a 10,000-dollar net loss today holds a 7,000-dollar deduction against future gains โ worth entering into the calculator as a known offset next year rather than forgotten in a drawer.
๐ Key takeaways
- The four inputs that decide everything are basis, proceeds, holding period, and your other taxable income โ brackets stack.
- A 12,000-dollar long-term gain cost Maya 1,800 at 15 percent but would have cost 2,640 as a short-term gain in 2025 โ the calendar is worth real money.
- 0 percent bracket harvesting is real: 18,350 dollars of room above Robert's 30,000 taxable income made a 25,000-dollar gain cost about 998.
- NIIT applies to the lesser of investment income or the amount over 200,000 single / 250,000 joint โ a 760-dollar surtax on one couple's 60,000-dollar gain.
- Section 121 erased a 330,000-dollar home gain entirely for a qualifying married couple; single filers get 250,000.
- Each result is an educational estimate โ state tax, Medicare premiums, and wash-sale timing live outside the calculator.
โ Frequently asked questions
Can I use 2026 brackets if I am estimating a 2025 sale?
Match the year to the sale: 2025 sales use 2025 thresholds (0 percent to 48,350 single / 96,700 joint), and 2026 sales use the wider ones (49,450 / 98,900). Using the wrong year shifts the answer by a small amount that grows with the gain.
Does the calculator include state tax?
Most simple tools are federal-only, and this guide's figures are federal. Most states tax gains as ordinary income; a few states levy no income tax. Model the state separately or with a professional, especially for large sales.
What if I do not know my exact basis?
Estimate first, then reconstruct: broker statements, reinvested-dividend records, and improvement receipts. An overstated basis understates tax โ the direction that creates penalties โ so err conservative and document everything you claim.
Are dividends counted as capital gains?
Qualified dividends use the same 0/15/20 rate table but are not sale gains; they are reported separately, and fund capital gain distributions behave similarly. The calculator handles sale gains; check fund statements for distributions.
How does a big gain interact with estimated taxes?
A material gain usually requires a quarterly estimated payment to avoid an underpayment penalty; the safe harbors and dates are covered in our quarterly estimated tax calculator guide. Increased withholding from other income can also substitute.
Is the tool useful for crypto?
Yes โ crypto is treated as property, so every sale or trade is a disposal with its own basis, proceeds, and holding period. Sum the year's disposals, or run the largest ones individually to see the rate tiers at work.
The free Capital Gains Tax Calculator on Toolfyra runs everything in your browser โ no signup, nothing uploaded.
Open the Capital Gains Tax Calculator โ๐ More in the Toolfyra blog ยท or browse all free online tools.