Cost Basis Calculator
Calculate your exact tax cost basis, realized capital gains, and remaining portfolio lots using standard FIFO, LIFO, and Weighted Average accounting methods.
Purchase Lots (Tax Lots)
Under FIFO method: 180 shares sold for $13,500 total proceeds ($8,900 cost basis).
Cost Basis Calculator - FIFO, LIFO & Average Cost Tax Accounting: Calculate tax cost basis, realized capital gains, and remaining portfolio lots using FIFO, LIFO, and Average Cost. 100% free and private browser utility.
How to Use the Cost Basis Calculator
List Purchase Lots
Enter each separate purchase tranche with number of shares bought and price paid per share.
Choose Tax Accounting Method
Select between FIFO (First-In, First-Out), LIFO (Last-In, First-Out), or Weighted Average Cost.
Enter Sale Details
Specify how many total shares were sold and your execution sale price per share.
Audit Realized Gain & Remaining Basis
Review your taxable capital gain and the remaining cost basis carried forward for future tax returns.
Financial Planning Guide: Stock Cost Basis Methods: FIFO, LIFO, and Specific Identification
Cost basis is the original purchase price of an asset adjusted for stock splits, dividends, and transaction fees, used by tax authorities to determine your capital gain or loss when shares are sold. When an investor accumulates shares of a company through multiple separate transactions over time at varying prices (known as purchase lots or tax lots), determining exactly which shares were sold when a partial liquidation occurs has a dramatic impact on taxable income.
The IRS and global tax authorities recognize three primary accounting methods:
- FIFO (First-In, First-Out): The default method used by most brokerage houses. Assumes the oldest shares purchased are the first shares sold. In rising markets, FIFO typically produces the largest taxable capital gains because older shares were bought at lower prices, but qualifies gains for lower long-term capital gains tax rates.
- LIFO (Last-In, First-Out): Assumes the newest shares purchased are sold first. In bull markets, LIFO minimizes current taxable gains by matching sales against higher recent purchase prices, but may trigger higher short-term capital gains tax rates.
- Weighted Average Cost (WAC): Divides total dollars invested across all lots by the total number of shares owned to establish a uniform blended cost basis per share. Standard for mutual fund and index holdings.
Selecting the optimal cost basis method through Specific Identification allows strategic tax-loss harvesting and tax liability deferral, preserving more capital for ongoing compound growth.
Key Benefits & Features
Triple Method Simulation
Instantly compares tax implications under FIFO, LIFO, and Weighted Average Cost.
Multi-Lot Management
Supports multiple chronological purchase lots with automated dollar cost tracking.
Taxable Gain Isolation
Separates gross sales proceeds from cost basis to isolate exact IRS reportable gains.
Remaining Inventory Audit
Calculates the remaining share balance, remaining basis, and blended price per share.
Tax-Loss Harvesting Aid
Helps investors identify high-cost lots to sell first to offset realized investment gains.
Confidential & Browser-Only
No financial credentials, broker connections, or trade histories are saved or shared.
What is the default cost basis method used by brokers?
Under IRS regulations, FIFO (First-In, First-Out) is the default method used by all US brokerage firms unless the investor actively elects another method (like Specific Lot Identification or Average Cost).
Can I change my cost basis method after selling?
No. You must choose your tax lot accounting method before or at the time the trade is executed. Once a sale has settled, you cannot retroactively change the accounting method with your broker.
What is Specific Identification?
Specific Identification allows you to hand-pick the exact purchase lots you wish to sell (for instance, selling only shares bought on June 12th at $80) to intentionally realize a loss or long-term gain.
How do reinvested dividends affect cost basis?
Each reinvested dividend creates a brand new purchase lot with its own unique purchase date, share count, and cost basis equal to the purchase price on that dividend payment date.
What happens if I sell shares at a loss and buy them back?
Beware the IRS Wash-Sale Rule: if you sell shares at a loss and repurchase substantially identical shares within 30 days before or after the sale, the tax loss is disallowed and added to the cost basis of the repurchased shares.
Related Investing Calculators
Frequently Asked Questions
Yes, Cost Basis Calculator – FIFO, LIFO & Average Cost Tax Accounting is 100% completely free to use online with no hidden subscription fees, accounts, or software installation required.
Absolutely. All processing occurs securely within your web browser. Your inputs, calculations, and files are never stored, logged, or uploaded to external servers.
Yes. Cost Basis Calculator – FIFO, LIFO & Average Cost Tax Accounting is fully responsive and optimized for seamless use across smartphones, tablets, laptops, and desktop computers.
No plugins, extensions, or downloads are required. Cost Basis Calculator – FIFO, LIFO & Average Cost Tax Accounting operates directly in any standard, modern web browser.