Stock Price Calculator

A stock price calculator estimates the total cost of purchasing shares including commissions, calculates your average cost basis, and determines profit or loss when you sell. Enter your stock details below to instantly see your investment breakdown.

What Is a Stock Price Calculator?

A stock price calculator is a tool that computes the true cost of purchasing shares in a company. It goes beyond the listed share price to account for brokerage commissions, the effective cost per share after fees, and the profit or loss you would realize if you sold at a given price. Stock investors use it to evaluate entries, compare trade scenarios, and track investment performance with precision.

How Stock Cost Is Calculated

Many investors focus on the price per share and overlook commissions and fees that affect their actual cost basis. A stock buy calculator makes this calculation transparent by showing the full picture: how much you are really paying per share, how much you need the stock to increase before breaking even, and what your return percentage would be at any given sell price.

How to Calculate Stock Purchase Cost

Total Cost Formula

The total cost of buying shares is calculated by multiplying the share price by the number of shares and adding any commission or transaction fee:

Total Cost = (Share Price × Number of Shares) + Commission

This total is also your cost basis, the figure the IRS uses to determine your capital gain or loss when you eventually sell. Keeping an accurate cost basis is essential for tax reporting. The IRS Publication 550 provides detailed guidance on how investment income and expenses are treated for tax purposes, including cost basis rules.

Including Commissions and Fees

Commissions reduce your effective return even when the stock price rises. If you pay a $10 commission on a $500 investment, you immediately have a 2% hurdle to clear before breaking even. Many modern brokers offer zero-commission trades for US stocks, but international brokers, options trades, mutual funds, and ETFs often still carry fees. Including the commission in your cost basis is not optional — it is a legal requirement for accurate capital gains reporting.

Your effective cost per share is calculated by dividing the total cost (including commission) by the number of shares:

Effective Cost per Share = Total Cost ÷ Number of Shares

How to Calculate Average Cost Basis

Cost basis per share is the average price you paid per share after accounting for all purchases and fees. When you buy shares multiple times at different prices (dollar-cost averaging), the average cost basis is calculated by dividing the total amount invested (including all commissions) by the total number of shares owned:

Average Cost Basis per Share = Total Amount Invested ÷ Total Shares Held

For example, if you bought 100 shares at $20 and later bought 100 more shares at $30, your total investment is $5,000 (ignoring fees) and you hold 200 shares. Your average cost basis is $5,000 ÷ 200 = $25 per share. This matters for tax purposes because capital gains are measured against your cost basis, not the price of any individual purchase. If you purchased the same stock across multiple transactions, use our stock cost basis calculator to enter all your lots and get your weighted average instantly. The SEC investor guide on cost basis explains how different cost basis methods (FIFO, average cost, specific identification) affect your tax calculation. For more complex investment analysis, the accounting AI solver can work through multi-lot cost basis scenarios.

How to Calculate Stock Profit or Loss

Profit/Loss Formula

Profit or loss on a stock sale is the difference between what you received from selling your shares and what you originally paid (your cost basis):

Profit Loss Calculation
Profit / Loss = (Sell Price × Shares) − Total Buy Cost

A positive result is a profit (capital gain). A negative result is a loss (capital loss). Capital gains are taxable income. Short-term capital gains (assets held under one year) are taxed as ordinary income. Long-term capital gains (assets held over one year) are taxed at lower preferential rates of 0%, 15%, or 20% depending on your income.

Return on Investment Percentage

Return on investment (ROI) expresses profit or loss as a percentage of the original investment. It allows you to compare the performance of different investments on an equal footing regardless of the dollar amounts involved:

Return % = (Profit or Loss ÷ Total Buy Cost) × 100

An ROI of 10% means you earned $0.10 for every dollar invested. A -5% ROI means you lost $0.05 per dollar invested. ROI does not account for how long you held the investment; annualized return calculations are needed for time-adjusted comparisons. Use the percentage calculator if you need to cross-check percentage calculations or convert between different percentage formats.

Stock Calculator Examples

Example — Buying 50 Shares at $25

You buy 50 shares at $25 per share with a $10 commission.

Total buy cost = (50 × $25.00) + $10.00 = $1,260.00
Effective cost per share = $1,260.00 ÷ 50 = $25.20
Break-even sell price = $25.20 per share

Your cost basis is $1,260. If you sell below $25.20 per share, you lose money even if the stock price appears to be above your $25 buy price. This is why including commissions in your cost basis calculation matters for every trade.

Example — Selling for Profit

Using the same purchase of 50 shares at $25 with a $10 commission (total cost basis $1,260), you later sell all 50 shares at $32 per share.

Gross sale proceeds = 50 × $32.00 = $1,600.00
Profit = $1,600.00 − $1,260.00 = $340.00
Return = ($340.00 ÷ $1,260.00) × 100 = 26.98%

Note that this return does not account for any sell-side commission, which would reduce your net proceeds. If there is also a $10 sell commission, net proceeds become $1,590 and profit drops to $330, reducing the return to 26.19%. Always include both buy and sell commissions for an accurate net return calculation.

Understanding Stock Fees and Commissions

Brokerage commissions have changed dramatically over the past decade. In 2019, major US brokers including Charles Schwab, TD Ameritrade, and E*TRADE eliminated commissions on US stock and ETF trades. However, commissions still apply in several contexts:

  • Options contracts — Most brokers charge $0.50 to $0.65 per contract even when equity trades are free.
  • International stocks — Trading foreign shares or ADRs often carries commissions and foreign exchange fees.
  • Mutual funds — Many actively managed funds carry sales loads (front-end or back-end fees) of 1% to 5%.
  • OTC and penny stocks — Brokers often charge per-share commissions for over-the-counter securities.
  • Robo-advisors and managed accounts — These typically charge an annual management fee of 0.25% to 1% of assets under management.
  • SEC and FINRA fees — Small regulatory fees apply to sell transactions regardless of broker. These are typically less than $0.01 per share but accumulate on large trades.

Even zero-commission brokers may charge fees for account transfers, paper statements, or certain trade types. Reading the full fee schedule before selecting a broker is important for active traders. For business-level investment tracking and financial analysis, the accounting AI solver can help model portfolio-level cost and return calculations.

Frequently Asked Questions

Stock Price Calculator FAQ

How do I calculate stock cost?

Total stock cost = (share price × number of shares) + commission. For example, buying 50 shares at $25 with a $10 commission costs (50 × $25) + $10 = $1,260. Your effective cost per share is $1,260 ÷ 50 = $25.20. This total is your cost basis for tax purposes.

What is cost basis?

Cost basis is the total amount you paid for a stock including purchase price and commissions. It is used to calculate your capital gain or loss when you sell. The IRS requires you to report gains and losses relative to your cost basis, not the current market price. If you bought the same stock multiple times at different prices, use our stock cost basis calculator to find your weighted average cost per share. Different cost basis methods (FIFO, average cost, specific identification) can affect your tax liability.

How to calculate ROI on stocks?

ROI = (profit or loss ÷ total cost) × 100. If you spent $1,260 buying shares and sold for $1,500, your profit is $240 and your ROI is (240 ÷ 1260) × 100 = 19.05%. For annualized ROI, you would also factor in the holding period.

Are stock commissions tax deductible?

Stock commissions are not directly deductible as an expense, but they are added to your cost basis, which lowers your taxable capital gain when you sell. Buy-side commissions increase your cost basis. Sell-side commissions reduce your sale proceeds. Both effects reduce the capital gain (or increase the capital loss) you report to the IRS.

How to calculate break-even price on a stock?

Break-even sell price = total cost ÷ number of shares. If your total buy cost including commission was $1,260 for 50 shares, your break-even price is $1,260 ÷ 50 = $25.20. You must sell above $25.20 per share to make any profit. If there is also a sell commission, add that to the break-even calculation.

Related Tools