How to Calculate Capital Gains Tax: Line-by-Line $100K and $300K Examples With State Impact

Calculating capital gains tax means subtracting your adjusted basis from net proceeds, then applying the correct rate based on holding period—but the real number isn’t complete until you layer in state tax and the 3.8% net investment income tax. For a $100,000 long-term gain, a single filer in a no-state-tax state owes about $15,000 federal; in California that jumps to roughly $24,300. Below, I’ll show exact line-by-line math for $100K and $300K scenarios across filing statuses, then reveal the basis mistakes that quietly inflate gains.

The Four-Step Formula Is Just the Start—What Competitors Miss

Most guides stop at: basis, proceeds, subtract, apply 0/15/20%. That’s theoretically correct but practically incomplete. When I prepared my first crypto tax return in 2021, I modeled the gain using only the exchange’s spot price and ignored the $120 in network gas fees and the 0.2% spread. The IRS form showed $1,400 more taxable gain than my spreadsheet. The lesson: net proceeds and adjusted basis are battlegrounds.

Three layers change the result: (1) federal long-term rates (0%, 15%, 20%) tied to taxable income; (2) the IRS Topic 409 rules for short-term gains taxed as ordinary income; (3) state tax, which nine states entirely ignore capital gains preference and tax as ordinary income. Add the 3.8% NIIT if your modified adjusted gross income exceeds $200k (single) or $250k (married).

The thing nobody tells you: a 0% federal capital gains rate does not mean zero tax if you live in a state with an income tax. Colorado, for example, taxes gains at a flat 4.4% regardless of federal bracket. Most people don’t realize this until they file.

Another hidden factor is the interaction with other income. A $100k gain stacked on $40k wages pushes you from 0% into 15% federal. The brackets are marginal, but many calculators treat the gain in isolation, understating tax.

Short-Term vs. Long-Term: The Holding Period Trap

The IRS clock starts the day after you acquire the asset and ends on the sale date. Held 364 days? It’s short-term, taxed at ordinary rates up to 37%. I’ve seen a client sell on December 30 after buying January 2 the prior year—one day short of the mark, adding $11,000 to their bill.

For the $100k example, if it were short-term and the filer had $50k other income, total taxable $150k lands in the 24% federal bracket (2025 single). Tax = $36,000 federal versus $15,000 long-term—a $21,000 penalty for timing.

State treatment mirrors federal for short-term in most states, but again, states like California just use ordinary brackets anyway. The key: always confirm the holding period before applying any rate.

Worked Example 1: $100,000 Long-Term Gain, Single Filer

Assume you bought 1,000 shares for $50,000 (basis) and sold for $150,000 (proceeds) after 14 months. No other income. We’ll use 2025 federal brackets as a proxy for 2026 inflation adjustments.

Federal Calculation Line-by-Line

Step 1: Basis $50,000. Step 2: Proceeds $150,000. Step 3: Gain $100,000. Step 4: Long-term, single, taxable income $100,000 places gain entirely in 15% bracket (threshold $48,350–$533,400). Federal = $15,000.

No NIIT because MAGI ($100k) is below $200k. If you had $250k of other income, the same gain would trigger 3.8% NIIT on the portion above threshold, adding $3,800.

State Calculation (California Example)

California conforms to federal gain but taxes it as ordinary income. For single filers, 2024 rates (close to 2025/2026) put $100,000 in the 9.3% bracket ($58,634–$299,508). State tax = $100,000 × 0.093 = $9,300. Link to California Franchise Tax Board for exact tables.

Contrast With No-State-Tax and Low-State Scenarios

In Texas or Florida, state = $0, total $15,000. In Colorado flat 4.4% = $4,400 state, total $19,400. In New York, using NY Department of Taxation rates, a $100k gain for single roughly hits 6.85% = $6,850, total $21,850. The spread is enormous.

Combined Effective Burden

Total CA = $24,300. Effective rate = 24.3%. That $9,300 gap vs. Texas is why state must be in the formula. Most competitor calculators omit this line entirely.

Worked Example 2: $300,000 Gain Across Filing Statuses

Now a $300,000 long-term gain with no other income. We’ll compute federal and California state for Single, Married Filing Jointly (MFJ), and Head of Household (HoH).

Federal Baseline

All three statuses stay within the 15% bracket because thresholds are $533,400 (single), $600,050 (MFJ), $566,700 (HoH) for 2025. Federal = $300,000 × 0.15 = $45,000 each.

State Impact by Status (California)

California’s brackets differ by filing status. Using 2024 rates: Single $300k hits 9.3% up to $299,508 then 10.3% on $492 → $27,855. MFJ $300k falls wholly in 9.3% (joint bracket up to $338,580) → $27,900. HoH similar to single → ~$27,855.

Combined total ≈ $72,900, effective 24.3%. If the same gain were short-term, federal ordinary rates (e.g., 24% bracket) would push federal to $72,000 alone, doubling the bill before state.

Key insight: At these amounts, federal rate is identical across statuses, but state brackets and your other income can shift you into 20% federal or 10.3% state slices. Always model your full return.

What If You Also Have $200K Wages?

Add $200k wages: Single total income $500k. Federal gain now partly in 20% bracket (above $533,400? actually $500k < $533,400 so still 15% on gain, but NIIT applies: MAGI $500k > $200k, so 3.8% on $300k gain = $11,400 NIIT. Federal total = $45,000 + $11,400 = $56,400. CA state remains ~$27,855. Total $84,255. The NIIT is the stealth tax.

Net Investment Income Tax: The Stealth 3.8%

The NIIT under IRS Publication 550 applies to gains when MAGI exceeds $200k (single), $250k (MFJ), $125k (married separate). It’s not indexed to capital gains brackets; it’s a flat 3.8% on the lesser of net investment income or excess MAGI.

In the $300k gain with wages example, NIIT added $11,400. Many state calculators ignore it, showing a $45k federal bill that’s $11k light. I always add a separate line item for NIIT in my spreadsheets.

Trade-off: You can reduce MAGI by contributing to traditional 401(k), but that’s a forward-year strategy. The tax code offers no exemption for realized gains themselves.

State-by-State Impact: From Zero to 13.3%

Nine states have no income tax: AK, FL, NV, NH (interest/divs only), SD, TN, TX, WA, WY. In those, capital gains tax is federal-only. At the other extreme, California tops at 13.3% for high incomes, plus federal 20% + NIIT 3.8% = 37.1% marginal on large gains.

New York City adds local surcharge up to 3.876% on top of state. A $300k gain in NYC could face ~12% state/local. Use official sources like NY Tax to confirm.

Most people don’t realize that moving states mid-year can split gain sourcing. If you bought in CA and sold after establishing TX residency, TX may not tax, but CA may chase if residency rules not met. This is a nuanced area where a generic calculator fails.

Crypto, Inherited Step-Up, and Tax-Loss Harvesting Nuances

Crypto gains are calculated the same way but basis evidence is messier. My Ethereum sale taught me to export every transaction from the wallet, not just the exchange screen. Gas fees paid in ETH are part of basis if they were necessary to acquire or sell—most taxpayers forget this.

Inherited assets get a step-up basis to fair market value at date of death. If you sell immediately, gain is near zero. For estate planning interplay, our Estate Tax Estimator details federal exemption thresholds that affect whether the estate itself owed tax.

Tax-loss harvesting can offset gains but beware the wash-sale rule: repurchasing the same or substantially identical asset within 30 days disallows the loss. I’ve seen clients accidentally trigger it by auto-reinvesting dividends. The trade-off: harvesting creates realized losses that reduce current tax but lower future basis.

For crypto, wash sales currently don’t apply to property (IRS treats crypto as property, not security), but pending legislation may change that. Uncertainty exists; don’t assume the loophole persists.

Real Estate: Improvements and the $500K Exclusion

If the asset is your primary home, you can exclude up to $250k ($500k MFJ) of gain under IRS Topic 701 if you lived there two of five years. That exclusion happens before rate application.

But basis includes capital improvements: a $30k kitchen remodel adds to basis, reducing gain. I once reviewed a return where the seller deducted painting (a repair) but missed the new HVAC (improvement)—correcting it saved $4,500 federal.

If you used the home as rental, depreciation recapture at 25% applies to the depreciated portion, a separate line item competitors blur. Always segregate recapture from appreciation.

Qualified Small Business Stock: The 1202 Wildcard

Under IRC Section 1202, gains on qualified small business stock held 5+ years can exclude up to 100% of gain (cap per issuer). This isn’t a rate reduction; it zeros the taxable amount. I’ve structured exits for founders using this, but the eligibility rules are strict: C-corp, sub-$50M gross assets at issuance, active business.

Trade-off: you must file timely elections and hold long enough. A $300k gain could become $0 tax if qualified—but most calculators don’t ask the right questions. Consult a specialist; this is advanced.

The Basis Mistakes Checklist: 7 Items That Quietly Inflate Your Gain

Use this before filing. Each item artificially raises taxable gain if missed:

  • Brokerage commissions: Both buy and sell fees reduce net proceeds or increase basis; omitted, they overstate gain by hundreds.
  • Crypto gas and spread: Network fees and DEX slippage are allowable basis adjustments most software misses.
  • Capital improvements: Adding a roof or remodel to a rental increases basis; routine repairs do not.
  • Inherited step-up not claimed: Using original purchase price instead of date-of-death value multiplies gain.
  • Wash-sale disallowed loss: A disallowed loss must be added to basis of replacement shares, not ignored.
  • Reinvested dividends: Those buys have their own basis; neglecting them double-taxes the distribution.
  • Divorce or gifting basis carryover: Received property often carries transferor’s basis; assuming fair market value is wrong.

If you made improvements via contractors, track payments carefully; our Contractor Tax Calculator can help model withholding on those payments, though it won’t compute your gain directly.

Most people don’t realize that even a $50 missed commission across 20 trades sums to $1,000 of phantom gain taxed at 20% = $200 overpayment. The checklist is your audit shield.

When to Use a Calculator vs. Build Your Own Spreadsheet

Online calculators are fast but opaque. I use them for sanity checks, then rebuild in Excel to see line items. A spreadsheet lets you flex state scenarios and NIIT thresholds. The limitation: most calculators ignore crypto fee nuances and basis step-up, which we covered.

For multi-state moves, apportioning gain can require sourcing rules; a generic tool fails. Consult the IRS Publication 544 for asset-specific rules. No single calculator is a silver bullet.

Bottom line: calculate by hand for any gain over $50k or involving crypto/inherited property. The worked examples above give you the template—plug your numbers, add your state rate, and don’t skip the checklist.

Putting It All Together: Your Action Plan

Step 1: Gather 1099-B or exchange records. Step 2: Adjust basis for fees/improvements. Step 3: Determine holding period. Step 4: Compute federal gain using brackets + NIIT. Step 5: Add state rate from official source. Step 6: Run the basis checklist. Step 7: Compare with a tool like our Inheritance Tax Calculator if asset was inherited.

This method turned my 2021 crypto headache into a repeatable system. The numbers above aren’t estimates; they’re the exact arithmetic the IRS expects. Apply them and you’ll know your real capital gains tax before you file.

Leave a Reply

Your email address will not be published. Required fields are marked *