Purchase Cost Estimate

Free Cost Basis of Stock Calculator

Estimate average purchase cost from your own lot prices or historical-close proxies for supported USD stocks. A daily close is not your execution price. This tool does not calculate tax-lot basis, realized gains, or corporate-action adjustments.

Manual or Historical Inputs
Multiple Purchase Lots
100% Free

Purchase Lots

Purchase #1
Purchase #2

FMP supplies split-adjusted historical closes and quote snapshots. Use matching share quantities for every lot. Availability and timestamps vary; this tool does not retrieve your brokerage records.

What Is Cost Basis of a Stock?

Cost basis is the original value of a stock investment for tax purposes. When you purchase shares of a company, the cost basis is typically the price you paid per share multiplied by the number of shares, plus any commissions or transaction fees. This figure is essential because it determines your capital gain or loss when you eventually sell the shares.

For purchases at different prices, the total entered acquisition cost divided by the total shares gives a weighted average. Historical closes provide a hypothetical purchase-price proxy. Use your transaction records for actual cost and tax reporting; this tool does not select sold lots or process tax adjustments.

How to Use This Cost Basis of Stock Calculator

  1. 1

    Search for the Stock

    Type the ticker symbol (e.g., AAPL, TSLA, MSFT) in the search box and select the correct company from the dropdown results.

  2. 2

    Add Your Purchase Lots

    For each purchase, enter the number of shares and the date you bought them. The calculator looks for a close on or before that date within seven days. You can also enter a manual price if you know the exact price you paid.

  3. 3

    Add More Lots as Needed

    Click "Add Lot" to include additional purchases. There is no limit to the number of lots you can add.

  4. 4

    Review Your Results

    Click "Calculate Cost Basis" to see your weighted average cost per share, total investment, current market value, and unrealized profit or loss — all based on your entered quantities and prices or available provider data.

Cost Basis Formula

The weighted average cost basis is calculated using this formula:

Total Cost = ∑ (Sharesi × Pricei)

Average Cost Basis = Total Cost / Total Shares

Unrealized P&L = (Current Price − Average Cost) × Total Shares

For a hypothetical example, assume you bought 50 shares at $150 and later bought 30 more shares at $170, your total cost is (50 × $150) + (30 × $170) = $12,600 for 80 shares. Your average cost basis is $12,600 / 80 = $157.50 per share.

Why Cost Basis Matters for Investors

Tax Reporting

Your cost basis determines the capital gain or loss reported on your tax return. A higher cost basis means a smaller taxable gain (or larger deductible loss) when you sell. Accurate cost basis tracking is required by the IRS.

Break-Even Analysis

The average entered cost is a price-only reference. Exit costs, income, financing and taxes can change the true break-even result; these are not modeled here.

Dollar-Cost Averaging

If you invest a fixed amount regularly, your cost basis reflects the weighted average of all purchase prices. Regular purchases change entry timing but do not guarantee a profit or protect against a sustained decline.

Portfolio Performance

Entered costs and a quote snapshot give an unrealized price-only comparison. Dividends, realized sales, cash flows and holding periods are needed for broader return analysis.

Cost Basis Accounting Methods

U.S. stock-sale basis generally follows the actual identified lot. If shares cannot be adequately identified, FIFO generally applies. Average basis has limited eligibility; it is not the default method for ordinary individual stocks.

  • Position average here: a descriptive weighted average of entered purchases, not a tax election.
  • Specific identification: identify the shares with the broker and retain the required confirmation and records.
  • FIFO: generally uses the earliest acquired shares when adequate identification is unavailable.
  • Eligible average basis: certain mutual-fund and dividend-reinvestment-plan shares can qualify under IRS rules. Check the required election and eligibility.
  • LIFO/HIFO labels: lot-selection preferences do not override identification requirements or determine the best after-tax result by themselves.

See IRS Topic 703 and Publication 550. This page does not calculate a tax return.

Events That Adjust Your Cost Basis

Several corporate actions and events can change your cost basis beyond simple purchases:

  • Stock Splits — A 2-for-1 split doubles your shares and halves your cost per share. The total cost basis remains the same before other adjustments. The calculator does not adjust quantities: you must match each lot to the fetched price basis.
  • Reinvested Dividends — Dividends reinvested to buy additional shares increase your total shares and total cost basis. Each reinvestment is a new purchase lot.
  • Return of Capital — Distributions classified as return of capital generally reduce basis; amounts beyond zero basis may be taxable. This calculator does not apply that adjustment.
  • Wash Sales — If you sell at a loss and buy substantially identical securities within 30 days before or after the sale, wash-sale rules may disallow the loss. Replacement-share basis treatment has exceptions, including IRA purchases; this tool does not calculate it.
  • Mergers & Acquisitions — When companies merge, your cost basis may be allocated across new shares or cash received based on the exchange ratio.

Frequently Asked Questions

What is cost basis of a stock?

Tax basis generally starts with actual purchase cost and acquisition expenses, then follows applicable adjustments and lot-identification rules. This tool computes an average acquisition-cost estimate, not the tax basis of shares sold.

How does this cost basis calculator work?

This calculator fetches real historical closing prices from FinancialModelingPrep for the stock ticker and purchase dates you provide. It calculates the weighted average cost per share across all your purchase lots, then compares it to the current market price to show your unrealized profit or loss.

What is the difference between cost basis and average cost?

Average purchase cost is total entered cost divided by entered shares. It is useful for a position summary, but generally is not an allowed U.S. stock-sale tax-basis method except for qualifying mutual-fund and dividend-reinvestment-plan shares.

How is weighted average cost basis calculated?

Weighted Average Cost Basis = Total Cost of All Purchases / Total Shares Owned. For example, if you bought 50 shares at $100 and 50 shares at $120, your total cost is $11,000 for 100 shares, giving an average cost basis of $110 per share.

Does this calculator account for stock splits?

The FMP close series is split-adjusted. The calculator does not fetch splits or adjust your quantities. Use the matching current-share equivalent for each lot when using those closes; never mix original pre-split quantities with adjusted prices. For records-based estimates, use manually entered lot costs and quantities on the same split basis.

Can I include commissions and fees in my cost basis?

Yes. Use the manual price override option for any lot and add your per-share commission to the stock price. For example, if you paid $150 per share plus $10 total commission on 10 shares, enter $151 as the manual price.

Why does my purchase date show a different price date?

The lookup chooses the latest available close on or before the requested date within a seven-day request window. This is a modeling convention, not a broker settlement rule or proof of your actual fill. No earlier observation means an error, not a future-price substitution.

Is this stock cost basis calculator free?

The page is free and requires no registration. Market-data access and supported USD symbols depend on provider coverage and availability. Manual prices still require a selected symbol and a valid quote snapshot for the valuation comparison.

Review Chart Rules with Pineify

Draft and inspect chart indicators or simulated strategies with Pineify. This separate workflow does not manage tax lots or execute brokerage orders from this calculator.