Stock Cost Basis Calculator.
Know Your Break-Even Before Selling.
Calculate your exact average cost basis after multiple stock purchases. See how many more shares you need to reach any target price — and understand your tax position before you sell.
Average Down Calculator
Find the exact shares needed to hit your target average
Your Position
Ready to calculate
Fill in your position details and hit Calculate
What Is Stock Cost Basis?
Your cost basis (also called adjusted cost base or average cost) is the average price per share you paid across all purchases of a stock, including commissions and fees. It is the number that determines your taxable gain or loss when you sell.
Average Cost Method Formula
Cost Basis = Total Amount Invested ÷ Total Shares OwnedTaxable Gain Formula
Gain/Loss = (Sale Price − Cost Basis) × Shares SoldExample: You buy 100 shares at $80 and 100 shares at $60. Total invested = $14,000, total shares = 200. Cost basis = $70/share. If you sell at $90, your taxable gain = ($90 − $70) × 200 = $4,000.
Cost Basis Methods: FIFO vs Average Cost
Average Cost Method
- Blends all purchases into one cost
- Most common for retail investors
- Required for mutual funds
- Simplest to track and calculate
- This calculator uses this method
FIFO (First In, First Out)
- Sells earliest-purchased shares first
- Can minimize short-term gains
- Better when first buys were at high prices
- Requires lot-level tracking
- Common for stocks held in taxable accounts
Watch Out: The Wash Sale Rule
If you sell shares at a loss and buy the same or substantially identical stock within 30 days before or after the sale, the IRS disallows the tax loss (wash sale rule). The disallowed loss is added to the cost basis of your new shares. Investors who average down into a falling stock should be aware that averaging down within 30 days of a loss-sale can trigger this rule.
Frequently Asked Questions
What is cost basis and why does it matter?▾
Cost basis is the original value of your investment — typically the total amount paid including commissions. It matters because when you sell, your taxable gain or loss = sale price − cost basis. A lower cost basis means higher taxable gains. Accurate cost basis tracking ensures you don't overpay taxes or miscalculate your actual profit.
How do I calculate cost basis for multiple stock purchases?▾
Using the average cost method: Cost Basis = Total Dollars Invested ÷ Total Shares Owned. Example: Buy 100 shares at $50 ($5,000) and then 50 shares at $40 ($2,000). Total invested = $7,000, total shares = 150. Cost basis = $7,000 ÷ 150 = $46.67 per share. Our calculator handles this automatically for any number of purchases.
What is the difference between FIFO and average cost method?▾
FIFO (First In, First Out): assumes you sell your earliest-purchased shares first. This can result in higher taxes if your first purchases were at low prices. Average Cost Method: calculates a blended average of all purchases and uses that as the basis for all sales. Most individual retail investors use average cost for simplicity. Mutual funds are required to use average cost unless you specify otherwise.
Does averaging down lower my cost basis?▾
Yes. Buying more shares at a lower price mathematically reduces your average cost basis. Example: 100 shares at $100 (basis = $100). Buy 100 more at $60 (basis drops to $80). This is the core mechanic of averaging down — you reduce the price at which you break even. Use our calculator to see exactly how many additional shares lower your basis to your target price.
What is the wash sale rule and how does it affect cost basis?▾
The wash sale rule (IRS) disallows a tax loss deduction if you buy a substantially identical security within 30 days before or after selling at a loss. The disallowed loss is added to the cost basis of the replacement shares, increasing your basis — meaning a higher taxable gain (or lower loss) when you eventually sell. Investors who average down into a losing position must be careful not to trigger wash sales.
Related Tools & Guides
Disclaimer: This calculator is for educational purposes only and does not constitute tax or financial advice. Cost basis rules vary by country. Consult a licensed tax professional or financial advisor for your specific situation.