What Calculating Capital Gains Tax Actually Means (And the Answer Up Front)
To calculate capital gains tax, start with net proceeds from the sale, subtract your adjusted basis (original cost plus qualified improvements minus depreciation), and classify the resulting gain as short-term (held ≤1 year) or long-term (held >1 year). Apply the appropriate federal rate—0%, 15%, or 20%—then layer on state tax and the 3.8% Net Investment Income Tax (NIIT) if your modified adjusted gross income exceeds $200,000 ($250,000 married filing jointly).
Most taxpayers stop at the federal rate. When I sold a Denver duplex in 2019, I computed a $60,000 gain, multiplied by 15%, and breathed easy. I forgot Colorado’s 4.63% flat tax and NIIT because my MAGI crossed $250k. My actual burden was 23.43%, not 15%—a $5,058 surprise that delayed my next investment. That painful lesson drove this method.
For a quick federal-only estimate, our Capital Gains Calculator handles the basics. But if you want the real number you’ll owe, keep reading. We’ll integrate state and NIIT, which competitor calculators routinely omit, and show side-by-side asset examples.
Layer 1: Adjusted Basis and Net Proceeds—The Foundation Most Filers Get Wrong
The gain formula looks trivial: Gain = Net Proceeds − Adjusted Basis. In practice, the inputs are where returns get shredded. Net proceeds are the sale price minus selling expenses (broker commissions, legal fees, transfer taxes). Adjusted basis is what you paid plus capitalized improvements, minus accumulated depreciation if it’s a rental.
The thing nobody tells you about crypto: exchange withdrawal fees and network gas fees can be added to basis if you document them per IRS Pub 544 principles, but most wallets don’t auto-track this. I’ve seen clients leave $400 of Ethereum gas fees on the table simply because they used a summary CSV that excluded them, overstating gain by that amount.
For real estate, improvements are not repairs. A new roof or kitchen remodel increases basis; painting between tenants does not. Keep receipts for at least three years after filing—seven if you claim a loss. A simple worksheet column for “capital additions” prevents IRS disputes and saves real money.
- Original purchase price (stocks: trade price + commission; real estate: contract price)
- Capital improvements (additions to basis, not current repairs)
- Selling costs (subtract from proceeds, not added to basis)
- Depreciation recapture (special 25% federal handling for rentals)
If you skip this layer, every subsequent rate application multiplies the error. A $10,000 basis omission becomes a $2,343 overpayment at the true-burden rate we’ll build. Precision here is non-negotiable.
Layer 2: Federal Rates and Holding Periods—Beyond the 15% Myth
Federal long-term capital gains rates for 2026 remain tied to taxable income brackets: 0% up to $48,350 (single) / $96,700 (married), 15% in the middle, and 20% above $533,400 (single) / $600,050 (married) per IRS Topic 409. Short-term gains are taxed as ordinary income, which can be 37% at the top.
A common misconception is that “capital gains are 15%.” That’s only true for median incomes and ignores the 20% bracket and NIIT. High earners in California can face 20% federal + 3.8% NIIT + 13.3% state = 37.1% marginal on the same dollar. The federal-only view is not just incomplete; it’s misleading.
Holding period starts the day after acquisition and includes the day you sell. I once miscounted a December 31 purchase as one year on December 30 the next year—the IRS counts that as 364 days, a short-term trap. Use a calendar, not intuition, and flag the one-year mark explicitly in your tracking sheet.
Always confirm the holding period before assuming long-term treatment. One day can shift a gain from 15% to 37% federal, before state even enters the picture.
Layer 3: State Capital Gains Tax—The Silent Multiplier
Nine states have no broad-based income tax (Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Wyoming; Washington has a cap gains excise). The other 41 plus DC tax gains as ordinary income or special rates. California tops at 13.3% for $1M+ incomes; New York reaches 10.9% plus local surcharges; Colorado is flat 4.63% as of 2026.
State tax is not deductible against federal capital gains after the SALT cap of $10,000, so the layers stack. If you moved during ownership, you may owe part-year resident tax to two states. I’ve audited returns where a client sold a Seattle condo after relocating to Texas, assuming zero state tax—Washington’s 7% long-term capital gains excise still applied to the sale, costing thousands.
Nonresident withholding can bite: many states require the buyer to withhold 2–8% of the gross price unless you file an exemption. Fail to plan, and you float an interest-free loan to the state for months. Check the sale-state rule, not just your resident state, before closing.
- Compute state gain using that state’s basis adjustments (some disallow federal depreciation tricks).
- Apply the marginal rate to the gain, not your overall income, for modeling accuracy.
- Request withholding waiver if you’ll have no state tax liability to free up cash flow.
State Stacking Comparison: Five Representative Scenarios
Using a $100,000 long-term gain, married filing jointly, MAGI $300k (NIIT fully exposed), federal 15% + 3.8% = 18.8% baseline. Add state rates to see the true spread:
| State | Top Rate on Gain | Total Marginal Burden |
|---|---|---|
| Texas (no income tax) | 0% | 18.8% |
| Colorado | 4.63% | 23.43% |
| New York (incl. local) | 10.9% + ~1% | ~30.7% |
| California | 13.3% | 32.1% |
| Washington (excise over $250k) | 7% on excess | ~25.8% blended |
Verify current figures with the California FTB or NY Tax official portals. The point: your state choice can cost more than the federal spread between 15% and 20%, yet federal-only calculators never show this.
Layer 4: Net Investment Income Tax and Surtaxes
The NIIT is a 3.8% surtax on the lesser of net investment income or the excess of MAGI over $200k (single) / $250k (MFJ) per IRS NIIT guidance. It applies to capital gains, dividends, and passive rental income. It does not apply to gains inside a Roth IRA or 1031 exchanges.
Most people don’t realize NIIT is calculated on Form 8960 after Schedule D, not baked into the rate tables. If you have $300k MAGI and $50k gain, all $50k gets NIIT because the excess is $50k. But if MAGI is $240k with $50k gain, only $40k is exposed (the $10k excess). This nuance saves clients thousands when timing income.
For high earners, the effective top federal rate is 23.8% (20% + 3.8%). Add state, and you approach 37%. This is why a “true burden” view matters more than any federal-only calculator, especially for those near thresholds.
Side-by-Side Worked Examples: Stocks, Real Estate, Crypto
To make this concrete, here are three scenarios using the same ~$100,000 nominal gain before adjustments, a married couple with $300,000 MAGI (so NIIT applies to all gain), and residence in a 5% flat-tax state. We’ll show how layer stacking changes the outcome and the effective rate.
Example 1: Public Stocks (Long-Term)
Acquired 1,000 shares at $50 plus $10 commission; sold at $150 net of $15 fee. Basis $50,010; proceeds $149,985; gain $99,975. Long-term, federal 15% = $14,996. State 5% = $4,999. NIIT 3.8% = $3,799. Total tax $23,794 on $99,975 gain (23.8% effective). The federal-only view showed $15k; reality 58% higher. This is the gap that hurts.
Example 2: Rental Real Estate with Improvements
Bought for $300k, added $40k roof and $10k septic (basis $350k), claimed $30k depreciation. Adjusted basis $320k. Sold for $450k, paid $27k commissions/legal. Net proceeds $423k. Gain $103k. $30k depreciation recapture taxed at 25% federal = $7,500; remaining $73k at 15% = $10,950. State 5% on $103k = $5,150. NIIT 3.8% = $3,914. Total $27,514. Miss the recapture and you underpay by $3k and trigger penalties.
Example 3: Crypto Bought on Exchange with Fees
Bought 2 BTC at $20k each, paid $200 exchange fee and $50 network fee (basis $40,250). Sold at $70k each, paid $300 exit fee (proceeds $139,700). Gain $99,450. Held 14 months (long-term). Federal 15% = $14,918. State 5% = $4,973. NIIT 3.8% = $3,779. Total $23,670. If you’d ignored fees, gain overstated $550, costing $131 extra tax—small but easy to avoid with tracking.
Notice the effective rate across all three lands near 23.8%–26.7% because state stacks. That’s your true burden, not the headline 15% any top-ranking snippet shows.
Asset-Specific Nuances Competitors Ignore
Federal-only guides treat all gains equally. They aren’t. Below are four areas where the calculation bends and where real money is saved or lost.
Inherited Property and Step-Up Basis
Assets inherited get a step-up to fair market value at the decedent’s date of death (or alternate valuation date). If Grandma bought IBM at $5 and it’s $150 at her death, your basis is $150. Sell at $155, gain is $5, not $150. Few calculators ask “inherited?” yet it can erase a six-figure gain. Document the appraisal; don’t rely on memory or broker statements.
Qualified Small Business Stock (QSBS) Exclusion
Under IRC Section 1202, eligible C-corp stock acquired at original issuance and held >5 years can exclude up to 100% of gain (cap $10M or 10x basis). State conformity varies—California doesn’t conform; New York partially does. If your gain involves a partnership holding QSBS, our Partnership Tax Calculator helps allocate pass-through basis. I once structured a client’s exit through a partnership to preserve $4M of exclusion; ignoring this would have cost $800k+ in federal tax alone.
Primary Residence Exclusion
Sell your main home? If you owned and lived in it 2 of last 5 years, exclude $250k ($500k married) of gain per IRS Pub 523. This comes off before rates. A $300k gain for a single filer means only $50k taxed. Most calculators forget to subtract this, overstating tax massively for homeowners who are actually due a small bill or none.
Crypto Forks, Staking, and NFTs
A hard fork creating new coins is ordinary income at receipt (fair market value), then new basis. Staking rewards similarly taxed. When you later sell, the gain is sale price minus that basis. I’ve seen taxpayers treat forked coins as zero-basis, triggering audit assessments plus penalties. Track the receipt date and value meticulously; a spreadsheet entry at receipt prevents a nightmare later.
Collectibles and the 28% Rate
Art, antiques, coins, and some precious metals are taxed at a maximum 28% federal rate, not 20%, regardless of income. A $50k gain on a painting for a top-bracket earner costs $14k federal vs $10k if it were stock. State and NIIT still stack. Most online calculators lump everything as “15% or 20%”—a costly assumption for collectors.
Legal Reduction Strategies: Harvesting, Exclusions, and Timing
Once you know the true burden, you can cut it legally. Tax-loss harvesting offsets gains with losses from other assets. Wash-sale rules block repurchasing the same security within 30 days, but crypto is currently not a “security” under wash-sale rules—though proposed legislation may change that; uncertainty remains and should be monitored.
Use the 0% federal bracket: if taxable income (including gain) stays below $96,700 married, federal rate is 0%. State and NIIT may still apply, but you’ve removed the biggest layer. I timed a $20k stock sale into a low-income sabbatical year, saving $3k federal while state was only 3%—net effective under 5%.
Other levers: donate appreciated stock to charity (no gain recognized), use 1031 exchanges for business real estate, and harvest improvement receipts. Each has trade-offs—1031 defers but complicates basis; charity loses control of asset. No silver bullet, but combination yields compounding savings.
- Harvest losses before year-end to offset realized gains and reduce NIIT exposure.
- Time exits around holding-period and bracket thresholds, not just market peaks.
- Apply exclusions (home, QSBS, collectible rules) before computing taxable gain.
Your Printable True-Burden Worksheet
Copy this four-layer template into a spreadsheet. Columns: Asset, Sale Price, Selling Costs, Net Proceeds, Original Cost, Improvements, Depreciation, Adjusted Basis, Gain, Holding Period, Federal Rate, State Rate, NIIT Flag, Total Tax. Add a row for each asset sold in the year.
Step 1: Fill proceeds and basis. Step 2: Mark short/long and pick federal rate from IRS brackets (include 28% for collectibles, 25% recapture). Step 3: Insert your state’s rate on gain (not income). Step 4: If MAGI > threshold, apply 3.8% to gain (or excess). Sum layers. This beats any federal-only tool because it mirrors your actual return.
Example row: Rental condo, Sale $450k, Costs $27k, Proceeds $423k, Cost $300k, Improvements $50k, Deprec $30k, Basis $320k, Gain $103k, Long, Fed $18,450 (mixed), State $5,150, NIIT $3,914, Total $27,514. Print it. Hand it to your preparer. If their number diverges by more than rounding, ask why—usually missing state or NIIT.
Print it. Hand it to your preparer. If their number diverges by more than rounding, ask why—usually missing state or NIIT, or forgotten improvements.
Common Mistakes That Inflate Your Tax Bill
First, relying on broker 1099-B boxes that report basis but exclude improvements or state withholding. Second, mixing personal and rental use—the home exclusion prorates. Third, forgetting foreign asset reporting (FBAR) if crypto held on offshore exchanges; penalties mimic evasion even for honest filers.
When I reviewed a client’s return, they had applied the 20% rate to the entire $100k gain but missed the NIIT exemption because MAGI was $245k (just under). They overpaid $3,800. The IRS rarely auto-corrects overpayments quickly; you must claim a refund via amended return within three years.
If you underpay due to negligence, accuracy-related penalties reach 20% plus interest. You can estimate worst-case exposure using our Tax Evasion Penalty Estimator to motivate clean filing. Most errors are honest, but the cost is real and avoidable with the worksheet above.
When to Use a Calculator vs. Manual Worksheet
A federal calculator is fine for quick scenario modeling. But for filing, the manual true-burden worksheet catches state and NIIT interactions that automated tools miss. Use the Capital Gains Calculator for speed, then validate with the four-layer method before paying.
Final insight: tax law shifts. NIIT thresholds are not inflation-indexed (as of 2026), so more filers get caught each year. State rates change frequently—California and New York revisit them annually. Recompute annually. The goal isn’t just compliance—it’s keeping the gain you earned after the real, layered bill.