ReturnsCalc Free Investing Calculators
Investing Guide · Updated May 2026

Stock Profit Calculator: What You Made, Owe, and Keep

Selling a stock feels good — until you figure out what you actually cleared after taxes, fees, and inflation. That number is usually smaller than the one you've been mentally celebrating. Here's how to calculate it correctly, because your gross gain and your actual wealth increase are two very different figures.

11 min read·Informational only — not financial or tax advice

In This Guide

  1. Gross Profit: The Starting Formula
  2. Step 1: Subtract Transaction Costs
  3. Step 2: Calculate Capital Gains Tax
  4. Calculate Your Stock Profit Now
  5. Step 3: Get Your Cost Basis Right
  6. Step 4: Factor In Inflation
  7. Full Worked Example
  8. Frequently Asked Questions

A proper stock profit calculation has four layers: gross gain, minus transaction costs, minus taxes, adjusted for inflation. Most people stop at layer one. The gap between layer one and layer four is where bad decisions live — holding losers chasing phantom gains, getting blindsided by a tax bill, or comparing two trades using different standards. This guide closes all four gaps.

Start With the Basics: Gross Profit on a Stock Trade

The starting formula is straightforward. If you bought 200 shares at $34.50 and sold at $51.00, you have a headline number. It's also the least useful version of your return.

Gross Profit = (Sale − Buy) × Shares
($51.00 − $34.50) × 200 = $3,300

Step One: Subtract Your Transaction Costs

Commission-free trading is the norm at major US brokerages — Fidelity, Schwab, and Robinhood all offer $0 stock trades. But "commission-free" doesn't mean "cost-free." Options contract fees ($0.50–$0.65 per contract), bid-ask spread on illiquid stocks, regulatory fees on sell orders, and ADR custody fees ($0.01–$0.03/share annually) all still apply depending on your strategy. On larger positions these are negligible. On a $500 position, a $6.95 round-trip commission from an older platform eats 1.4% before the stock moves a dollar.

Net Gain Before Tax = Gross Profit − Total Transaction Costs

Step Two: Calculate Your Capital Gains Tax

This is where most retail investors either oversimplify or avoid the math entirely. The IRS distinction between short-term and long-term capital gains is one of the most financially significant details in personal investing — and one of the few you have direct control over.

⚠ Short-Term Gains
Held 12 months or less
Up to 37%
Taxed as ordinary income — same rate as your salary. At 32% bracket on $3,300 gain: $1,056 owed, keeping $2,244.
✓ Long-Term Gains
Held more than 12 months
0 / 15 / 20%
Preferential federal rates. At 15% bracket on $3,300 gain: $495 owed, keeping $2,805. That's $561 more for one extra day.

The difference between those two scenarios — $2,244 versus $2,805 — is $561 on a $3,300 gain. That's 17% more money kept simply by crossing the 12-month mark. The holding period decision is a legitimate financial strategy, not just patience.

The one-day difference. In some cases, holding a position just one day past the 12-month anniversary converts short-term gains into long-term gains — potentially dropping your effective tax rate by 17+ percentage points. Know your lot dates before you sell.

2024 Long-Term Capital Gains Rate Brackets

For tax year 2024, long-term capital gains rates depend on total taxable income:

RateSingle FilersMarried Filing Jointly
0%Up to $47,025Up to $94,050
15%$47,026 – $518,900$94,051 – $583,750
20%Over $518,900Over $583,750

Don't Forget State Taxes

Most US states tax capital gains as ordinary income. California taxes investment gains at up to 13.3%. New York at up to 10.9%. A handful of states — Texas, Florida, Nevada, and others — have no state income tax, meaning your federal rate is your total rate. A calculator that ignores state taxes gives you an incomplete picture if you live somewhere with meaningful state-level taxation.

NIIT for higher-income investors. If your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly), an additional 3.8% Net Investment Income Tax applies to capital gains on top of federal rates. It's not widely covered in basic investing guides but materially affects real returns above those thresholds.

Stock Profit Calculator

Calculating…

Step Three: Factor In Your Cost Basis Accurately

Your cost basis — what you actually paid, including any commissions — determines your taxable gain. There are four situations that catch investors off guard repeatedly.

🔄
Dividend Reinvestment (DRIP)
Each reinvested dividend creates a new tax lot with its own cost basis and purchase date. Selling the full position may mean dozens of lots with different holding periods — some short-term, some long-term.
✂️
Stock Splits
A 2-for-1 split doubles your shares and halves your per-share basis. Total cost basis is unchanged, but the per-share calculation changes — and some brokerages report this incorrectly.
🏛️
Inherited Stock (Stepped-Up Basis)
Inherited shares receive a basis equal to fair market value on the date of the original owner's death — not what they paid. This can dramatically reduce the taxable gain on highly appreciated assets.
⚠️
Wash Sale Rule
Sell at a loss and buy the same or "substantially identical" security within 30 days before or after? The IRS disallows that loss — it adjusts your cost basis instead. It won't offset gains in the current year the way you might expect.

Step Four: What Did Inflation Do to Your Real Return?

This step gets skipped constantly, and it matters more the longer you hold. If you held a stock for six years and made 40% total — but inflation averaged 3.5% annually — your real purchasing power gain is considerably less than 40%.

Real Return = [(1 + Nominal) ÷ (1 + Inflation)] − 1
40% nominal gain over 6 years at 3.5% annual inflation:
Inflation factor: (1.035)6 ≈ 1.229  →  (1.40 ÷ 1.229) − 1 = ~13.9% real gain

Still positive — but not 40%. This matters when comparing a stock return against real estate appreciation, bond yields, or any inflation-sensitive benchmark. The nominal gain is what your brokerage reports. The real gain is what you can actually buy with the proceeds.

Putting It All Together: A Full Example

A 150-share position, held 14 months (qualifying for long-term rates), sold by a single filer in California. Every layer of cost accounted for — gross profit down to what actually stays.

Worked Example · 150 Shares · California Resident · Long-Term
The Position
150 shares @ $42.00 purchase price$6,300 cost basis
Sold @ $61.50 × 150 shares$9,225 proceeds
Commissions (major brokerage)$0
Gross & Tax
Gross profit$2,925
Federal tax — 15% long-term rate− $438.75
California state tax — 9.3%− $272.03
Total tax− $710.78
Net profit after all taxes — Net ROI: 35.1% vs 46.4% gross $2,214.22
46.4%
Gross ROI
The number most people celebrate. Doesn't account for the $710 tax bill that arrives later.
35.1%
Net ROI (after all taxes)
The number that actually moved your net worth. The 11-point gap is over $700 that never shows up in a basic calculation.

FAQ: Stock Profit Calculation Questions

How do I calculate profit if I bought shares at different prices over time?
You need to account for each tax lot separately — each purchase at a different price and date creates its own lot with its own basis and holding period. Most brokerages track this automatically. When you sell, you can specify which lots to sell (FIFO, LIFO, or specific identification), which affects both your gain and whether it qualifies as short or long-term.
Do I owe taxes on stock gains if I don't sell?
No. Unrealized gains — paper profits on positions you still hold — are not taxable events in the US. Tax liability only triggers when you sell, gift appreciated shares, or in certain corporate events. This is one of the structural advantages of buy-and-hold investing.
What if I sold at a loss — can that offset other gains?
Yes. Capital losses can offset capital gains dollar-for-dollar. If losses exceed gains, up to $3,000 of net capital loss can offset ordinary income annually. Any remaining loss carries forward to future tax years indefinitely. This is the basis of tax-loss harvesting as a strategy.
Does it matter which brokerage I use when calculating profit?
The math is the same across brokerages, but your 1099-B form will show your proceeds and cost basis — and some brokerages track adjusted basis more reliably than others, especially for DRIP shares and corporate actions. Always verify your cost basis rather than assuming the brokerage figure is correct.
How is profit on ETFs different from individual stocks?
For most purposes, identical — same capital gains rules, same holding period logic, same tax treatment on dividends. The main difference is that ETFs can distribute capital gains to shareholders even if you didn't sell, due to redemptions within the fund. These distributions are taxable in the year received even in a taxable account.

Gross Profit Is a Vanity Metric — Calculate What You Actually Keep

Run your real numbers — purchase price, sale price, shares, holding period — to see your true gain broken down clearly. Run it before you sell too. Knowing your tax exposure in advance lets you make the holding period decision with full information, not on April 14th.

Calculate My Net Stock Profit

⚠️ For informational purposes only — not tax or financial advice. Consult a tax professional for your specific situation.

More Free Calculators

Calculator

ROI Calculator — annualized return with S&P 500 benchmark comparison →

Calculator

Inflation-Adjusted Return — find your real purchasing power gain →

Calculator

Dividend Yield Calculator — yield on cost and annual income projection →