Stock Profit Calculator Guide 2026: Gains, Fees and Tax Math
Table of Contents
Profit Formula: Beyond Buy Low, Sell High
Example: Buy 100 shares at $45 ($4,500), sell at $62 ($6,200). Gross gain $1,700. Minus $0 commissions (most brokers) = $1,700 pre-tax.
Cost basis gets tricky with multiple purchases: FIFO (first-in-first-out) is the default; specific identification lets you pick tax lots — selling highest-cost shares first minimizes taxes.
Specific identification is a $300 decision hiding in your brokerage settings. Buy 100 shares at $40 ($4,000), later 100 at $60 ($6,000); sell 100 at $70. Under default FIFO, you sell the $40 lot: $3,000 gain, $450 tax at 15%. Elect specific ID and sell the $60 lot instead: $1,000 gain, $150 tax — same sale, $300 less tax. You must instruct the broker before settlement; after the trade settles, FIFO is locked in. Set your default to specific ID or highest-cost-first today.
Corporate actions silently adjust your basis. A 2-for-1 split turns 100 shares at $60 into 200 at $30 — same $6,000 basis, but your records must reflect it. Spinoffs split basis between parent and child by relative fair market value (check the company's Form 8937). And reinvested dividends raise basis: that $75 dividend reinvested makes your basis $6,075, not $6,000. Forget the adjustment and you pay tax twice on the same $75.
Short-Term vs Long-Term: The Tax Cliff
| Holding Period | Tax Treatment | Typical Rate |
|---|---|---|
| ≤ 1 year (short-term) | Ordinary income | 22-37% |
| > 1 year (long-term) | Capital gains | 0%, 15%, 20% |
On a $10,000 gain: short-term at 24% = $2,400 tax; long-term at 15% = $1,500. Holding 366 days instead of 364 saves $900. Never let the tax tail wag the investment dog — but be aware of the cliff near one year.
The day-count rule is brutally literal. Buy June 1, 2025; sell June 1, 2026 = 365 days = short-term (the clock starts the day after purchase). Sell June 2, 2026 = 366 days = long-term. One calendar day flips a $10,000 gain from $2,400 in tax (24%) to $1,500 (15%) — a $900 swing for waiting 24 hours. Before selling any position approaching its anniversary, count the days precisely; your broker's "unrealized gains" tab usually shows the holding period.
Stack every layer before calling it profit. High earners pay 15-20% federal plus 3.8% NIIT = 18.8-23.8%, and states pile on: California taxes gains as ordinary income up to 13.3%, turning a $10,000 long-term gain into roughly a $3,700 total tax bite. "Profit" means after federal, NIIT, and state — model your combined marginal rate, because the federal-only number in most calculators understates the real haircut by a third or more.
Full Trade Walkthrough
Trade: Buy 200 shares at $38.50 ($7,700) in March 2024. Sell at $51.25 ($10,250) in June 2026. Long-term hold.
- Gross profit: $10,250 − $7,700 = $2,550
- Return: 33.1% total, ~14.7% annualized
- Tax at 15%: $382.50
- Net profit: $2,167.50 (28.2% after tax)
Add a $75 dividend received: qualified, taxed at 15% = $11.25. Total after-tax profit: $2,231.25.
Options change the sale price. Assigned on a covered call? Your effective sale price = strike price ± premium received — a $70 strike call with a $3 premium exercised means $73/share for gain math, not $70. And the wash-sale rule reaches into options: selling stock at a loss and buying calls on the same stock within 30 days can disallow the loss, since options are "substantially identical" positions in the IRS's eyes. Option overlays don't just change returns; they change tax lots.
Currency moves can erase foreign-stock gains. A $5,000 gain on a European stock shrinks materially if the euro fell 8% against the dollar during your hold — your profit is measured in dollars, not euros. Brokers report in USD, but for large ADR positions, note the FX rate on both purchase and sale dates; a "20% winner" in local currency can be a 10% winner at home, and the tax bill is computed on the dollar figure regardless.
Common Profit Killers
- Frequent trading: Short-term taxes + bid-ask spreads compound against you. The average active trader underperforms by ~4%/year.
- Wash sales: Selling at a loss and rebuying within 30 days disallows the loss deduction.
- Ignoring basis adjustments: Reinvested dividends raise your basis — track them or overpay taxes.
- State taxes: Most states tax capital gains as income (California up to 13.3%) — factor this into "profit."
Beware the disposition effect: investors sell winners early to "lock in gains" while riding losers to zero — behavioral studies peg the cost at roughly 2-4% per year. Consider the asymmetry: a $10,000 winner sold at +20% banks $2,000; a $10,000 loser nursed to −60% destroys $6,000. Tax-aware harvesting of losers plus letting winners run past the one-year mark beats emotional selling by multiples of any bracket optimization. Check your realized-gain/loss ratio annually — if winners dominate sales, bias is costing you.
Flip the script with 0% gain harvesting. In a low-income year — sabbatical, grad school, early retirement — realize long-term gains up to $49,450 (single) of taxable income at 0% federal tax, then immediately rebuy. There is no wash-sale rule on gains, so the repurchase is clean and your basis steps up tax-free. A $30,000 gain harvested at 0% instead of 15% later saves $4,500 for the cost of two trades.
Frequently Asked Questions
Short-term (held ≤1 year): ordinary income rates. Long-term: 0%/15%/20% federal based on income, plus possible 3.8% NIIT above $200K/$250K.
What you paid, including commissions, adjusted for splits, reinvested dividends, and return-of-capital distributions. Accurate basis = accurate tax.
No — unrealized gains are untaxed. You only owe when you sell (or receive dividends).
If you sell at a loss and buy substantially identical securities within 30 days before or after, the loss is disallowed (added to the new shares' basis instead).
Splits adjust per-share basis proportionally; total basis is unchanged. A 2:1 split halves your per-share cost basis and doubles share count.