Stock Profit Calculator

Calculate your stock investment profits including all costs and taxes.

Trade Details

$
$
$
$
$
%
%

Net Profit

$2,201.50

43.99% total return

Total Cost
$5,005.00
Total Proceeds
$7,495.00
Gross Profit
$2,490.00
Total Tax
$388.50
Annualized Return
27.51%
Break-Even Price
$50.15

Breakdown

Price Change$25.00 (50.00%)
Dividends$100.00
Commissions-$10.00
Taxes-$388.50

Understanding Stock Profit Calculations

A stock profit calculator helps you determine your actual gains or losses from stock trades, accounting for purchase price, sale price, fees, and other costs. Understanding these calculations is essential for tracking investment performance and tax planning.

Key components of stock profit:

  • Cost basis: Original purchase price plus fees
  • Sale proceeds: Selling price minus fees
  • Capital gain/loss: Difference between proceeds and cost basis
  • Dividends: Cash payments received while holding
  • Total return: Capital gain plus dividends

Types of returns:

  • Absolute return: Total dollar profit or loss
  • Percentage return (ROI): Profit as percentage of investment
  • Annualized return: Return expressed as yearly rate

Stock Profit Formulas

Essential calculations for stock trading:

Stock Return Formulas

Profit = (Sell Price × Shares) - (Buy Price × Shares) - Total Fees

Where:

  • ROI= (Profit / Total Cost) × 100%
  • Total Return= Capital Gain + Dividends
  • Annualized= (1 + Total Return)^(1/years) - 1
  • Cost Basis= Purchase Price + Buy Commission

Understanding Cost Basis

What is cost basis?

Cost basis is the original value of an investment for tax purposes. It includes the purchase price plus any fees, commissions, or other acquisition costs.

Cost basis methods for multiple purchases:

  • FIFO (First In, First Out): Oldest shares sold first (IRS default)
  • LIFO (Last In, First Out): Newest shares sold first
  • Specific Identification: You choose which shares to sell
  • Average Cost: Average of all purchase prices (mutual funds only)

Adjustments to cost basis:

  • Stock splits (adjust price per share)
  • Reinvested dividends (add to basis)
  • Return of capital (reduces basis)
  • Merger/acquisition (may change basis)

Example of multiple purchases:

  • Buy 50 shares @ $40 = $2,000
  • Buy 50 shares @ $50 = $2,500
  • Total: 100 shares, average cost $45/share
  • Sell 50 shares @ $60: FIFO uses $40 cost, LIFO uses $50 cost

How to Use This Calculator

Our stock profit calculator analyzes your trades:

  1. Enter Purchase Details:
    • Number of shares bought
    • Purchase price per share
    • Commission/fees paid on purchase
  2. Enter Sale Details:
    • Sale price per share
    • Commission/fees paid on sale
  3. Optional - Add Dividends:
    • Total dividends received
  4. Enter Holding Period:
    • Buy date and sell date
    • For annualized return calculation

Results include:

  • Total profit or loss
  • Percentage return (ROI)
  • Annualized return
  • Break-even price
  • Tax implications (short vs long-term)

Capital Gains Tax Considerations

Short-term vs long-term capital gains:

  • Short-term (held ≤1 year): Taxed as ordinary income (10-37%)
  • Long-term (held >1 year): Preferential rates (0%, 15%, or 20%)

2024 Long-term capital gains rates:

  • 0%: Single up to $47,025 / Married up to $94,050
  • 15%: Single $47,026-$518,900 / Married $94,051-$583,750
  • 20%: Above those thresholds
  • +3.8%: Net Investment Income Tax for high earners

Tax-loss harvesting:

  • Sell losing positions to offset gains
  • Up to $3,000 of net losses can offset ordinary income
  • Excess losses carry forward to future years
  • Beware of wash sale rule (30-day window)

Wash sale rule:

Cannot claim loss if you buy same or substantially identical security within 30 days before or after the sale.

Total Return Analysis

Components of total return:

  • Capital appreciation: Price increase from buy to sell
  • Dividends: Cash payments during holding period
  • Dividend reinvestment: Additional shares purchased with dividends

Why total return matters:

  • Price-only returns understate performance of dividend stocks
  • High dividend stocks may have lower price appreciation but higher total return
  • Reinvested dividends compound over time

Example comparison:

  • Growth stock: $100 → $150 (50% price return, 0% dividend)
  • Dividend stock: $100 → $120 + $15 dividends (35% total return)
  • Growth stock wins on total return in this example
  • But with reinvestment over decades, dividends often win

Annualized return calculation:

Annualized Return = (Ending Value / Beginning Value)^(1/years) - 1

Common Mistakes to Avoid

Forgetting fees and commissions:

  • Include all trading costs in calculations
  • Even "free" brokers may have other costs (spread, payment for order flow)
  • Options assignment fees, SEC fees, etc.

Ignoring dividends:

  • Dividends are part of total return
  • Reinvested dividends change your cost basis
  • Qualified vs ordinary dividends have different tax rates

Not accounting for stock splits:

  • A 2-for-1 split doubles shares, halves cost basis per share
  • Your total cost basis doesn't change
  • Track adjusted cost basis carefully

Comparing apples to oranges:

  • Always use annualized returns for fair comparison
  • 50% return in 5 years ≠ 50% return in 1 year
  • Consider risk-adjusted returns

Worked Examples

Basic Stock Profit Calculation

Problem:

Buy 100 shares at $45 with $10 commission. Sell at $58 with $10 commission. Calculate profit and ROI.

Solution Steps:

  1. 1Total cost: (100 × $45) + $10 = $4,510
  2. 2Sale proceeds: (100 × $58) - $10 = $5,790
  3. 3Profit: $5,790 - $4,510 = $1,280
  4. 4ROI: ($1,280 / $4,510) × 100%
  5. 5ROI: 28.4%

Result:

Profit: $1,280. Return on investment: 28.4%. The $20 in fees reduced profit by about $20.

Total Return with Dividends

Problem:

Buy 200 shares at $30. Hold for 2 years, receive $240 in dividends. Sell at $35. Calculate total and annualized return.

Solution Steps:

  1. 1Initial investment: 200 × $30 = $6,000
  2. 2Capital gain: (200 × $35) - $6,000 = $1,000
  3. 3Dividends received: $240
  4. 4Total return: $1,000 + $240 = $1,240
  5. 5Percentage return: $1,240 / $6,000 = 20.67%
  6. 6Annualized: (1.2067)^(1/2) - 1 = 9.85%

Result:

Total return: $1,240 (20.67%). Annualized return: 9.85%. Dividends contributed 19% of total return.

Loss Calculation for Tax Purposes

Problem:

Buy 50 shares at $120. Sell at $85 after 8 months. Calculate loss and tax impact.

Solution Steps:

  1. 1Cost basis: 50 × $120 = $6,000
  2. 2Sale proceeds: 50 × $85 = $4,250
  3. 3Capital loss: $4,250 - $6,000 = -$1,750
  4. 4Holding period: 8 months = short-term loss
  5. 5Tax benefit: Can offset short-term gains
  6. 6Or offset up to $3,000 of ordinary income

Result:

Short-term capital loss: $1,750. This can offset gains or up to $3,000 of ordinary income. Unused losses carry forward.

Tips & Best Practices

  • Always include trading fees and commissions in profit calculations
  • Track your cost basis carefully for accurate tax reporting
  • Consider holding for more than 1 year for long-term capital gains rates
  • Use tax-loss harvesting to offset gains, but beware of wash sale rules
  • Calculate total return including dividends, not just price appreciation
  • Use annualized returns to compare investments fairly
  • Keep records of all purchases, especially for dividend reinvestment
  • Consider after-tax returns when comparing taxable vs tax-advantaged accounts

Frequently Asked Questions

Short-term gains (held 1 year or less) are taxed as ordinary income at your marginal rate (10-37%). Long-term gains (held more than 1 year) are taxed at preferential rates (0%, 15%, or 20%). The difference can be significant—a 37% vs 20% rate means keeping thousands more on large gains. Always consider holding period in sell decisions.
Yes! Total return = capital gains + dividends. Ignoring dividends understates your actual return. For dividend-paying stocks, dividends can be 30-50% of total return over time. Also track reinvested dividends as they increase your cost basis and share count.
Cost basis is your original investment amount including fees, used to calculate taxable gain or loss. Accurate cost basis is essential for tax reporting. If you've made multiple purchases, you need to track each lot separately or use FIFO/average cost method. Keep records—the IRS requires brokers to report cost basis, but they may have incomplete information.
Stock splits change shares and price per share but not total value. For a 2-for-1 split: shares double, price per share halves. Your cost basis per share adjusts proportionally, but total cost basis stays the same. Example: 100 shares at $80 becomes 200 shares at $40 cost basis per share.
The wash sale rule prevents claiming a tax loss if you buy the same or substantially identical security within 30 days before or after the sale. The disallowed loss is added to the cost basis of the replacement shares. This prevents selling for a tax loss and immediately repurchasing. It applies to stocks, options, and substantially similar securities.
Annualized return = (Ending Value / Beginning Value)^(1/years) - 1. This converts any holding period to an equivalent annual rate. Example: 50% return over 3 years = (1.50)^(1/3) - 1 = 14.5% annualized. Use this to fairly compare investments held for different periods.

Sources & References

Last updated: 2026-01-22