Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
CalculatorZilo Logo
Home / Stock Purchase Calculator
Stock Market Calculators

Stock Purchase Calculator

Published onApril 30, 2026 Updated onOctober 24, 2026 4:04 pm

Price a stock purchase before you place the order. The Shares to cost tab turns a share count into total cost, cost basis per share and break-even price with commissions included. The Amount to shares tab reverses it: how many shares, whole or fractional, a fixed investment buys, and what cash is left over. It is the buy-side companion to the stock sell calculator, which prices the exit; this page prices the entry. Once you know your cost, the stocks return calculator projects what that purchase needs to earn.

Stock Purchase Calculator
Total cost, cost basis and break-even, or shares from a fixed amount
Purchase summary

Cost basis figures follow the standard tax treatment: buy-side commissions are part of your basis. Confirm against your broker’s records at tax time.

Quick Answer

Buy 100 shares at $40 with a $100 commission: subtotal $4,000.00, total cost $4,100.00, cost basis $41.00 per share, break-even $41.00. Reverse it: $10,000 at $150 with a $5 commission buys 66.6333 fractional shares, or 66 whole shares for $9,905.00 with $95.00 left over. Both directions are pre-filled above: press Calculate to see the full arithmetic.

Key takeaways

  • Total cost = shares × price + commission. The commission is small next to the subtotal but it never disappears: it lives on in your cost basis.
  • Cost basis per share is your true entry price, and it is the number the tax authority uses when you sell. Buy-side commissions raise it, which lowers your taxable gain.
  • Break-even equals your cost basis: the sale price at which you neither gain nor lose, before sale-side fees.
  • Whole shares leave idle cash; fractional shares put nearly every dollar to work. The tool shows the leftover either way so the trade-off is explicit.
On this page
  • Quick Answer
  • How to use the stock purchase calculator
  • The stock purchase formulas
  • Worked examples, checked against this exact tool
  • Why cost basis matters for taxes
  • Whole vs fractional shares
  • What competing calculators miss
  • Frequently asked questions
  • Add This Calculator to Your Website
  • References

How to use the stock purchase calculator

Pick the tab that matches the direction of your question. Results stay hidden until you click Calculate, and Reset restores the worked example.

  1. Shares to cost: enter an optional stock symbol, the number of shares, the price per share and any commission. You get the subtotal, the total purchase cost, the cost basis per share and the break-even price.
  2. Amount to shares: enter the cash you want to invest, the price per share, any commission and whether you want whole or fractional shares. You get the share count, the total cost and the cash left over.

Use a limit-order price in the price field and the math holds at execution. Market orders fill at the next available price, which can be higher or lower than the quote on your screen, so treat market-order results as estimates.

The stock purchase formulas

Everything on this page comes from three lines of arithmetic. The commission is subtracted before shares are counted in the Amount to shares direction, because the fee is spent before any share is bought.

Total cost = Shares × Price + Commission
Cost basis per share = Total cost ÷ Shares
Shares = (Amount − Commission) ÷ Price (floored for whole shares)

The basis of stocks you buy is generally the purchase price plus the costs of purchase, such as commissions, which is exactly what IRS Publication 550 states in its chapter on stocks and bonds. That sentence is the entire tax logic of the Shares to cost tab: the $100 commission in the worked example is not a sunk cost to forget, it is $1.00 per share of basis that reduces your eventual taxable gain.

Worked examples, checked against this exact tool

The classic case: 100 shares of AAPL at $40 with a $100 commission. Subtotal = 100 × $40 = $4,000.00. Total = $4,000.00 + $100.00 = $4,100.00. Basis = $4,100.00 ÷ 100 = $41.00 per share. Break-even = $41.00: sell below it and you lose, sell above it and you gain, before sale-side fees.

1. Subtotal: 100 × $40.00 = $4,000.00→ 2. Total: + $100.00 = $4,100.00→ 3. Basis: ÷ 100 = $41.00/share→ 4. Break-even: $41.00

Every row below is a real run of this calculator. Type any of them in and you get the same figures back.

ScenarioModeResult
100 shares at $40, $100 commissionShares to costTotal $4,100.00, basis $41.00, break-even $41.00
50 shares at $120.50, no commissionShares to costTotal $6,025.00, basis $120.50, break-even $120.50
$10,000 at $150, $5 commissionAmount to shares (fractional)66.6333 shares, total $10,000.00
$10,000 at $150, $5 commissionAmount to shares (whole)66 shares, total $9,905.00, $95.00 left over
$1,000 at $50, no commissionAmount to shares (fractional)20.0000 shares, total $1,000.00, $0.00 left over

Display note: money figures are rounded to the nearest cent, so a fractional leftover smaller than half a cent reads $0.00, never −$0.00. An earlier version could print $-0.00 on some fractional inputs, a floating-point rounding artifact on the last fraction of a cent; the display now normalizes that negative zero to $0.00, with no change to any calculation.

Why cost basis matters for taxes

Taxable gain = sale proceeds − cost basis, so every dollar of commission folded into your basis is a dollar less of taxable gain. Buy-side commissions raise basis; sell-side commissions instead reduce proceeds, which is economically the same but reported differently. Brokers report sales on Form 1099-B, and you reconcile each sale's description, dates, proceeds and basis on Form 8949, with the totals flowing to Schedule D. The official Form 8949 instructions walk through exactly which columns each figure lands in.

Keep your own records regardless of what the broker sends. Basis gets adjusted by events after purchase: a 2-for-1 split halves your per-share basis without changing total basis, nontaxable distributions reduce it, and reinvested dividends create new lots at their own purchase prices, per IRS Publication 550. When you eventually sell at a gain, the capital gains distribution calculator and the capital loss deduction calculator handle the tax side of the exit; this page handles the entry.

Whole vs fractional shares

Whole-share mode is the classic brokerage behavior: the tool rounds down and the leftover cash sits idle. Fractional shares, now standard at most brokers, put nearly every dollar to work: $10,000 buys 66.6333 shares instead of 66, leaving pennies rather than $95 uninvested. The SEC's investor bulletin on fractional shares explains that you can generally place orders in dollar amounts or share amounts, and that the exact mechanics differ between brokerage firms.

Whole sharesFractional shares
Cash deployed$9,905.00 of $10,000$10,000.00 of $10,000
Left idle$95.00Effectively $0
Best forPositions you may transfer between brokersPutting every dollar to work immediately
Watch out forIdle cash drag on small accountsFractions can be harder to transfer between brokers

The trade-off is real but narrow: fractional wins on deployment, whole shares win on portability. Dividends on either are proportional to what you own, and the dividends calculator prices the income stream once the shares are yours.

What competing calculators miss

Cost calculators and share-count calculators each answer half the question, and none of them frame the answer for taxes:

  • Cost-only calculators (SageCalculator's stock purchase page): shares × price + commission, one direction. No cost basis per share, no break-even, and no way to ask how many shares a fixed amount buys.
  • Share-count calculators (SymbolabCalculator, OwnCalculator): the reverse direction only, (amount − fee) ÷ price, with no fractional toggle and no cost-basis framing at all.
  • Profit and average-cost tools (stockcalculator.io, OnlyCalculators' average calculator): strong on multi-lot averaging and realized profit, but they start from positions you already hold. None answers the pre-order question: what does this purchase cost, and how many shares does my cash buy.
  • The gap this page fills: both directions of the single purchase in one tool, with the tax-basis framing the others relegate to footnotes. Cost basis per share and break-even on the way in, whole-or-fractional share counts with explicit leftover cash on the way the cash goes in, and a reminder that buy-side commissions are basis, not sunk cost. Average-cost tools remain the right place for blending multiple lots later; this page is for pricing the order in front of you.

Frequently asked questions

Shares × price + commissions. Example: 100 × $40 + $100 = $4,100.

Total cost divided by shares: $4,100 ÷ 100 = $41.00. Your true entry price including fees.

The sale price matching your cost basis ($41.00 here): below it you lose, above it you gain, before sale fees.

(Amount − commission) ÷ price. At $150 with $5 commission: 66.6333 fractional shares, or 66 whole shares with $95.00 left over.

Buy-side commissions do: they raise your basis and lower taxable gains. Sell-side commissions reduce proceeds instead.

Fractional puts nearly all cash to work; whole shares leave leftovers but transfer between brokers more cleanly.

Market orders fill at the next available price. Use a limit order at your calculated price to lock the math in.

Not yet: average the lots with total cost ÷ total shares (e.g. (1200+1575) ÷ 25 = $111.00).

Brokers report it on Form 1099-B; you reconcile on Form 8949 / Schedule D. Keep your own records regardless.

Splits rescale per-share basis (2-for-1 halves it) without changing total basis; reinvested dividends add new lots at their purchase prices.

Add This Calculator to Your Website

Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.

Powered by Calculator Zilo

References

  1. Internal Revenue Service. Publication 550, Investment Income and Expenses: basis of stocks is the purchase price plus the costs of purchase, such as commissions. Accessed October 23, 2026.
  2. Internal Revenue Service. Form 8949, Sales and Other Dispositions of Capital Assets. Accessed October 23, 2026.
  3. Internal Revenue Service. Instructions for Form 8949. Accessed October 23, 2026.
  4. Internal Revenue Service. Form 1099-B, Proceeds From Broker and Barter Exchange Transactions. Accessed October 23, 2026.
  5. Internal Revenue Service. Topic No. 409, Capital Gains and Losses. Accessed October 23, 2026.
  6. U.S. Securities and Exchange Commission, Investor.gov. Fractional Share Investing: Buying a Slice Instead of the Whole Share. Accessed October 23, 2026.
  7. U.S. Securities and Exchange Commission, Investor.gov. Stocks. Accessed October 23, 2026.
  8. Financial Industry Regulatory Authority (FINRA). Stocks: Dividends and Capital Gains. Accessed October 23, 2026.
  9. Financial Industry Regulatory Authority (FINRA). Investing Basics. Accessed October 23, 2026.
  10. U.S. Securities and Exchange Commission, Investor.gov. Investment Glossary. Accessed October 23, 2026.
  11. Vanguard. Investment Glossary. Accessed October 23, 2026.

Related calculators

Stock Market CalculatorsBeta Calculator: Measure Stock Risk & Market ExposureBeta compresses a stock's relationship with the market into a single number.Stock Market CalculatorsStock Price Change CalculatorYou bought at $50 and the stock now trades at $65.Stock Market CalculatorsStock Margin CalculatorBuying stock on margin means the broker lends you part of the purchase price, and this calculator prices that...Stock Market Calculators Shares CalculatorHow many shares does your money buy? What will a block of shares cost once the broker takes its cut?Stock Market CalculatorsMarket Cap To Price CalculatorIf you know what a whole company is worth but not what one share should cost, the conversion is a single division: market capitalization divided by shares outstanding.Stock Market CalculatorsValue Of Stock Calculator Owning 100 shares means little until you price them.

We use cookies to analyze traffic and to serve ads that keep our calculators free. You can accept or decline cookies below. Learn more

calculatorzilo

CalculatorZilo

Free calculators for everyday life. No signup, no cost, just answers.

Categories

Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

Popular tools

Mortgage Payment Calculator BMI Walking Calculator Salary Per Minute Calculator Percentage Off Calculator

Company

About Us Contact Us Privacy Policy Terms and Conditions
Disclaimer Cookie Policy DMCA Policy FAQ Accessibility Statement

© 2026 CalculatorZilo • Free calculators for everyone

  • Home
  • Calculators
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
Search