Calculators / Cost Basis

Stock Cost Basis & Average Down Calculator

Combine multiple buy lots into a single weighted-average cost basis, and see exactly where the new break-even sits.

Buy lots

For unrealized P/L calculation.

Results

Advertisement · 728×90

What is cost basis?

Cost basis is the original value of an asset for tax purposes — typically the purchase price plus any commissions, fees, or adjustments. When you sell an investment, the IRS calculates your capital gain or loss as the sale proceeds minus your cost basis. Getting this number right directly determines how much tax you owe.

Cost basis tracking becomes complicated when you buy shares of the same security at different prices over time, receive dividends that are automatically reinvested, or go through corporate actions like stock splits or mergers. Errors in cost basis reporting are one of the most common causes of overpaid capital gains tax — and occasionally of underreported gains that trigger IRS notices.

The cost basis formula

At its simplest, cost basis for a single purchase lot is:

Cost Basis = Purchase Price per Share × Number of Shares + Commissions/Fees

When you have multiple lots (shares bought at different times and prices), you choose an accounting method to determine which shares you're selling. FIFO (first in, first out) assumes you sell your oldest shares first. Specific identification lets you choose exactly which lot to sell. Average cost divides total dollars invested by total shares held.

Worked example

You hold VTI purchased in three separate lots and want to sell 40 shares. Here is how the three methods compare:

Current price: $230. Selling 40 shares for $9,200 total proceeds.

When to use the cost basis calculator

Cost basis calculations matter any time you sell a taxable investment — the right accounting method can legally minimize your tax bill.

Common mistakes

Cost basis errors are surprisingly common, especially for investors who have held accounts for years across multiple brokerages.

Limitations of cost basis calculations

This calculator handles standard lot accounting, but real-world cost basis can get considerably more complex. Corporate actions — mergers, spin-offs, stock splits, rights offerings — require specific basis adjustments that vary by transaction type. For example, a stock split adjusts your per-share basis proportionally but does not change your total basis; a spin-off requires an allocation of the original basis between the parent and the spun-off company based on relative fair market values.

International investments introduce additional complexity: foreign stocks held through ADRs, currency-denominated positions, and PFIC (Passive Foreign Investment Company) holdings all have specialized cost basis rules. If your situation involves any of these, consult a CPA before filing — the penalties for PFIC reporting errors alone can exceed the tax owed.

Frequently asked questions

Which cost basis method saves the most tax?

Specific identification with highest-cost-first selection generally minimizes current-year capital gains, because you're selling the shares with the least embedded gain. However, the right answer depends on your tax situation: if you're in the 0% long-term capital gains bracket, it may be advantageous to realize gains now rather than defer them to a year when your income is higher.

What is the wash-sale rule?

The wash-sale rule (IRC §1091) disallows a capital loss if you buy a "substantially identical" security within the 30 days before or after the sale. Substantially identical generally means the same stock or ETF, but not necessarily a different fund tracking the same index. The disallowed loss adjusts the basis of the replacement security — it is deferred, not permanently lost.

Do I need to report cost basis on my tax return?

Yes. Every sale of a capital asset requires Form 8949, which lists each transaction with proceeds, basis, acquisition date, and sale date. Your broker's 1099-B reports this information for covered securities, but you are ultimately responsible for the accuracy of your return. Uncovered securities (purchased before 2011 for stocks) require you to track basis yourself.

What happens to cost basis when I receive a stock dividend or split?

In a stock split (e.g., 2-for-1), your number of shares doubles and your per-share basis halves — total basis is unchanged. Stock dividends work similarly. In a cash dividend that you reinvest, a new lot is created at the reinvestment price on the dividend payment date, and that amount is included in your taxable income for the year paid.

Related calculators

Cost basis intersects closely with these other calculations:

This calculator is for educational purposes. Consult a CPA or tax attorney for advice on your specific situation.

Advertisement · 336×280