Capital Gains Tax Estimator

Most investors know they owe taxes on investment profits, but few calculate the actual liability before selling. The result: unexpected tax bills, missed opportunities to harvest losses, and gains taxed at 37% instead of 15% simply because you sold a few weeks too early. The practical antidote is a step-by-step capital gains tax estimator—a worksheet you run before every sale to know your after-tax outcome in advance.
TL;DR: A capital gains tax estimator walks you through holding period, cost basis, tax bracket, and surtax calculations before you sell. Running the numbers first can mean the difference between a 0% rate and a 37% rate on the same gain.
Why You Need to Estimate Before You Sell (Not After)
Tax surprises erode returns. You sell a stock for a $20,000 profit, mentally bank the full amount, then discover in April that you owe $4,760 in federal tax—or $7,400 if you held for less than a year. The gap between those two numbers is entirely a function of timing and planning.
A capital gains tax estimator forces you to answer four questions before executing a trade:
- What is my adjusted cost basis? (purchase price + commissions + reinvested dividends)
- How long have I held this asset? (short-term ≤ 365 days vs. long-term ≥ 366 days)
- What is my total taxable income this year? (determines which rate bracket applies)
- Am I subject to the Net Investment Income Tax? (adds 3.8% above certain income thresholds)
The point is: every one of these inputs changes your tax bill materially. Getting them right before selling—not after—is what separates intentional tax management from reactive check-writing.
The Core Inputs (What Your Estimator Needs)
Adjusted Cost Basis
Your cost basis is the original purchase price plus commissions, fees, and any reinvested dividends. If you bought 200 shares of a stock at $75 per share and paid a $10 commission, your cost basis is $15,010 (not $15,000).
When you hold multiple lots of the same security purchased at different prices, you have a choice. The default method is FIFO (first in, first out), but specific identification lets you select which shares to sell. Choosing the highest-cost lots first minimizes your taxable gain. Confirm this election with your broker before the trade settles (not after).
Holding Period
This is the single biggest lever in your estimator. Assets held for more than one year (366+ days) qualify for long-term capital gains rates: 0%, 15%, or 20%. Assets held for one year or less are taxed at ordinary income rates: 10% to 37% in 2026.
Why this matters: on a $20,000 gain, the difference between a 15% long-term rate and a 24% short-term rate is $1,800. Track purchase dates for every position.
Your Tax Bracket
Long-term capital gains rates for 2026 depend on your total taxable income (not just investment income). Here are the federal thresholds:
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | $0–$49,450 | $49,451–$545,500 | Over $545,500 |
| Married Filing Jointly | $0–$98,900 | $98,901–$613,700 | Over $613,700 |
Short-term gains are taxed at your ordinary income rate, which ranges from 10% to 37% across seven brackets in 2026.
The point is: your capital gains rate isn't fixed. It depends on your other income that year. A gain realized in a year when you're between jobs (lower income) may be taxed at 0%, while the same gain in a high-earning year hits 15% or 20%.
The NIIT Surtax
The Net Investment Income Tax adds 3.8% on top of your capital gains rate if your modified adjusted gross income exceeds:
- $200,000 for single filers
- $250,000 for married filing jointly
- $125,000 for married filing separately
These thresholds are not indexed for inflation (they've been frozen since the NIIT took effect in 2013), so more taxpayers cross them each year due to wage growth. The maximum combined federal rate on long-term gains is therefore 23.8% (20% + 3.8% NIIT) for the highest earners.
Worked Example: Running the Estimator Step by Step
Here is a complete walkthrough. Follow these steps with your own numbers to estimate your liability.
Assumptions:
- Filing status: Single
- Salary and other income: $85,000
- You bought 300 shares of a stock at $50/share on March 1, 2025 (commission: $0)
- You plan to sell all 300 shares at $82/share on April 15, 2026
- No other capital gains or losses this year
Step 1: Calculate Adjusted Cost Basis
Purchase price: 300 × $50 = $15,000 Commissions: $0 Adjusted cost basis: $15,000
Step 2: Calculate the Gain
Sale proceeds: 300 × $82 = $24,600 Gain: $24,600 − $15,000 = $9,600
Step 3: Determine Holding Period
Purchase date: March 1, 2025 Sale date: April 15, 2026 Days held: 410 days Classification: Long-term (more than 365 days)
(If you had sold on February 28, 2026—just 364 days—this gain would be short-term and taxed at your ordinary rate of 22% instead of the long-term rate.)
Step 4: Determine Your Tax Bracket
Taxable income before the gain: $85,000 (after standard deduction, roughly $70,050 taxable) Taxable income including the gain: $70,050 + $9,600 = $79,650
Since $79,650 falls in the $49,451–$545,500 range for single filers, your long-term capital gains rate is 15%.
Step 5: Check for NIIT
Your MAGI (approximately $94,600 including the gain) is below the $200,000 single-filer threshold. NIIT: $0
Step 6: Compute Estimated Tax
| Line Item | Amount |
|---|---|
| Long-term capital gain | $9,600 |
| Applicable rate | 15% |
| NIIT | $0 |
| Estimated federal capital gains tax | $1,440 |
| After-tax proceeds from sale | $23,160 |
The practical point: without the estimator, you might assume you're pocketing $9,600. The actual after-tax gain is $8,160. And if you'd sold 46 days earlier (making it short-term at a 22% rate), your tax would have been $2,112—a $672 penalty for not checking the calendar.
Mechanical alternative: set a calendar reminder 13 months after every purchase. Before selling any position within that window, run the estimator to see if waiting a few more days or weeks drops you from short-term to long-term treatment.
Capital Losses: The Offset That Reduces Your Bill
Your estimator should also account for losses. Capital losses offset capital gains dollar for dollar—short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Any remaining net losses can offset the other category.
If your net capital losses exceed your gains, you can deduct up to $3,000 per year against ordinary income ($1,500 if married filing separately). Unused losses carry forward indefinitely.
The durable lesson: losses aren't just setbacks—they're tax assets. But you must realize them (sell the position) before December 31 to use them in the current tax year.
The Wash Sale Trap
If you sell a stock at a loss and repurchase the same or a substantially identical security within 30 days before or after the sale (a 61-day total window), the IRS disallows the loss deduction entirely. The disallowed loss gets added to the cost basis of the replacement shares instead.
The test: are you planning to buy back the same stock within a month? If yes, the loss deduction disappears. Either wait out the 61-day window or purchase a similar (but not substantially identical) investment to maintain market exposure.
Five Pitfalls the Estimator Helps You Avoid
Pitfall 1: Ignoring holding periods. Selling at 11 months instead of 13 months can nearly double your tax rate. The estimator flags this before you click "sell."
Pitfall 2: Using the wrong cost basis method. FIFO may force you to sell your lowest-cost (highest-gain) shares first. Specific identification lets you pick higher-cost lots and reduce the taxable gain. (Confirm the election with your broker before settlement.)
Pitfall 3: Forgetting the NIIT. High-income investors who calculate only the 15% or 20% rate and ignore the 3.8% NIIT surtax underestimate their bill. On a $100,000 long-term gain, that's an unexpected $3,800.
Pitfall 4: Missing the 0% bracket opportunity. If your taxable income (including the gain) stays below $49,450 (single) or $98,900 (MFJ) in 2026, you pay zero federal tax on long-term gains. Retirees, people between jobs, or those with large deductions often qualify. The estimator surfaces this opportunity.
Pitfall 5: Triggering wash sales during tax-loss harvesting. You sell a losing position in December, then your automatic dividend reinvestment plan repurchases shares of the same fund in January. The estimator's wash-sale check catches this before it voids your deduction.
State Taxes: The Variable Your Federal Estimator Misses
Federal rates are only part of the picture. State capital gains taxes range from 0% (nine states with no income tax) to 13.3% (California). A complete estimator adds your state rate to the federal calculation.
For the worked example above, if you live in a state with a 5% capital gains rate, your total estimated tax on the $9,600 gain rises from $1,440 to $1,920—a 33% increase in tax liability that a federal-only estimate would miss.
Build Your Estimator (Worksheet Template)
Use this template for any planned sale:
| Input | Your Numbers |
|---|---|
| Asset description | _______________ |
| Purchase date | _______________ |
| Purchase price (total) | _______________ |
| Commissions/fees paid | _______________ |
| Adjusted cost basis | _______________ |
| Planned sale date | _______________ |
| Expected sale price (total) | _______________ |
| Gain or loss | _______________ |
| Holding period (days) | _______________ |
| Short-term or long-term? | _______________ |
| Taxable income before gain | _______________ |
| Applicable federal rate | _______________ |
| NIIT applies? (Y/N) | _______________ |
| State capital gains rate | _______________ |
| Estimated total tax | _______________ |
| After-tax proceeds | _______________ |
Run this worksheet before every sale. It takes five minutes and prevents the two most expensive mistakes: selling too early (short-term treatment) and underestimating your effective rate (forgetting NIIT or state taxes).
Year-End Tax Estimator Checklist
Essential (High ROI)
- Check holding periods for any position you plan to sell—confirm it exceeds 365 days for long-term treatment
- Calculate your taxable income including all planned gains to determine your applicable bracket
- Review unrealized losses in your portfolio—harvest losses to offset realized gains dollar-for-dollar before December 31
- Check NIIT exposure if your MAGI is approaching $200,000 (single) or $250,000 (MFJ)
High-Impact (Workflow)
- Confirm cost basis method with your broker (specific identification vs. FIFO) before executing trades
- Scan for wash sale risk across all accounts, including automatic reinvestment plans, within the 61-day window
- Estimate state taxes by adding your state's capital gains rate to the federal calculation
Optional (Good for High-Income Investors)
- Model multi-year gain spreading—if you have flexibility on sale timing, splitting a large gain across two tax years may keep you in a lower bracket
- Review collectibles gains separately, as these are taxed at a maximum 28% rate regardless of holding period
Your Next Step
Pull up your brokerage account and identify any position you plan to sell in the next 90 days. Run it through the worksheet template above—fill in every line. Compare the after-tax proceeds against what you'd net if you waited until the holding period crosses the one-year threshold (if it hasn't already). That single comparison will show you exactly how much the estimator is worth to your portfolio.
Related Articles
Emergency Fund Calculator Instructions
59% of Americans can't cover a $1,000 unexpected expense from savings (Bankrate 2025). Meanwhile, 27% have zero emergency savings at all—the highest level Bankrate has ever recorded. The practical ...
Debt Paydown Snowball Calculator
Most people carrying multiple debts make the same mistake: they spread extra payments across every account, make minimal progress on each, and lose motivation within months. Research tracking 6,000...
Document Organizer Checklist for Investors
Most investors spend hours researching which stocks to buy but zero hours organizing the records that prove what they paid, what they sold, and what they owe. The cost of that gap is real: the FTC ...