Smart Kit Now

Cost Basis Calculator (FIFO/LIFO)

Calculate cost basis using FIFO or LIFO methods. Essential for accurate crypto tax reporting and portfolio tracking.

Calculation Formula

Cost Basis = Purchase Price × Quantity

Where:

Purchase Price= The price at which the asset was bought
Quantity= The amount of the asset purchased
Method= FIFO or LIFO, determining the order of asset sale

Example Calculation

Imagine you purchased 100 shares of a stock at $10 each using the FIFO method.

Step 1: Calculate the total purchase cost for the shares.

100 × $10 = $1000

Step 2: Assume the first purchased shares are sold first.

Apply FIFO method

Step 3: The cost basis for the sold shares is $1000.

Cost Basis = $1000

Result: The final cost basis is $1,000, which is used to calculate capital gains or losses.

How to Use the Cost Basis Calculator (FIFO/LIFO)

A cost basis calculator using FIFO or LIFO methods determines your capital gains or losses when you sell investments by tracking which shares you sold and at what price. Accurate cost basis calculation is essential for tax reporting because it directly impacts the size of your capital gain or loss, which affects your tax liability. The IRS requires you to report capital gains on Form 8949 and Schedule D, making this calculator a critical tool for tax compliance.

To use the calculator, you'll need to input several key pieces of information: your purchase dates, the number of shares bought at each date, the price per share for each purchase, your sale date, and the sale price per share. You'll also select your preferred accounting method—FIFO assumes you sell oldest shares first, while LIFO assumes newest shares sell first. Additional inputs may include stock splits, reinvested dividends, or adjustments for inherited securities with stepped-up basis.

The calculator outputs your total capital gain or loss, the adjusted cost basis per share, and your holding period to determine if gains qualify as long-term (over one year) or short-term. You can use this result to estimate your tax liability by applying the appropriate tax rate—long-term gains typically receive preferential rates of 0%, 15%, or 20%, while short-term gains are taxed as ordinary income. Always compare your calculator results against your broker's cost basis statement to identify discrepancies before filing your tax return.

FIFO vs. LIFO Cost Basis Example with Real Numbers

This table demonstrates how FIFO and LIFO methods produce different capital gains outcomes for the same stock position.

Purchase DateShares PurchasedPrice Per ShareTotal CostFIFO Sale OrderLIFO Sale Order
January 15, 202250$45.00$2,2501st Lot3rd Lot
July 8, 202350$82.50$4,1252nd Lot2nd Lot
November 22, 202450$115.00$5,7503rd Lot1st Lot
Sale Price (Current)50 shares sold$125.00$6,250Gain: $4,000Gain: $1,500

Selling 50 shares at $125 under FIFO results in $4,000 capital gain; under LIFO, only $1,500 gain. FIFO triggers higher taxes in rising markets.

2024-2025 Long-Term Capital Gains Tax Rates by Income Level

These federal tax rates apply to assets held over one year, showing how cost basis methods impact final tax liability.

Tax Filing Status0% Rate Income Limit15% Rate Income Range20% Rate Applies Above
SingleUp to $47,025$47,026–$518,900Over $518,900
Married Filing JointlyUp to $94,050$94,051–$583,750Over $583,750
Head of HouseholdUp to $62,700$62,701–$551,350Over $551,350
Married Filing SeparatelyUp to $47,025$47,026–$291,875Over $291,875

Rates are for 2024 tax year. A $10,000 long-term gain at 15% federal rate equals $1,500 tax; at 20%, it equals $2,000. Cost basis method selection can determine which bracket applies.

Common Cost Basis Tracking Scenarios and Calculator Input Requirements

Different investment situations require specific data inputs for accurate FIFO/LIFO calculations.

Investment ScenarioRequired InputsCalculator MethodTracking Complexity
Single purchase, one saleBuy date, quantity, price; sell date, priceFIFO/LIFO/Specific IDLow
Multiple purchases over yearsAll lot dates, quantities, prices; sale quantityFIFO/LIFO preferredMedium
Stock splits or dividends reinvestedAdjustment factors, dividend purchase datesFIFO/LIFO with adjustmentsHigh
Inherited shares with stepped-up basisDeath date fair market valueSpecific ID (new basis)High
Employee stock options (ESO) exercisedGrant date, exercise date, price per shareSpecific ID with holding periodVery High

Complexity increases with multiple lots and corporate actions. Most brokers provide adjusted cost basis reports, but manual calculators help verify accuracy.

Pro Tips

  • Obtain your official cost basis statement from your broker before using the calculator—Form 8949 or Schedule B from your brokerage contains adjusted basis figures that account for splits and dividends automatically.
  • When choosing between FIFO and LIFO, model both scenarios in the calculator to see the tax impact; in rising markets, LIFO typically reduces your capital gains by using higher-cost shares first.
  • Track the holding period carefully by noting purchase and sale dates in the calculator—a sale just before the one-year mark loses long-term status, potentially increasing your effective tax rate by 15–37% depending on your bracket.
  • Use the specific identification method in the calculator if you have multiple lots with significantly different purchase prices; this gives you the most control to minimize taxes by selling high-cost shares first.
  • Document all corporate actions such as stock splits, dividend reinvestments, and spin-offs in the calculator because these adjust your cost basis and affect your calculation accuracy and audit defensibility.

Common Mistakes to Avoid

Forgetting to account for reinvested dividends

Many investors overlook reinvested dividend shares when calculating cost basis, treating them as part of the original purchase. Reinvested dividends create separate cost basis lots at the dividend payment date and price, which must be tracked individually in FIFO/LIFO calculations or your gains will be overstated.

Mixing up holding periods across multiple lots

When you own multiple lots of the same security purchased on different dates, each lot has its own holding period. Using the calculator without tracking individual lot dates can result in incorrectly applying short-term rates to long-term holdings or vice versa, leading to overpaid taxes.

Ignoring wash sale adjustments

If you sold shares at a loss and repurchased within 30 days, the wash sale rule disallows the loss and adds it to the new shares' cost basis. The calculator alone won't flag wash sales, so you must manually adjust the cost basis of repurchased shares to include the disallowed loss amount.

Using estimated cost basis instead of broker records

Attempting to reconstruct cost basis from memory or old statements instead of obtaining an official broker statement creates audit risk and often produces incorrect results. The IRS expects you to use your broker's reported adjusted basis on Form 8949, not calculator estimates.

Overlooking stepped-up basis for inherited securities

If you inherited shares, you should use fair market value on the date of death as the new cost basis, not the deceased owner's original purchase price. Failing to adjust for stepped-up basis in the calculator can result in reporting inflated capital gains on inherited holdings.

Frequently Asked Questions

What is the difference between FIFO and LIFO cost basis methods?

FIFO (First-In, First-Out) assumes you sell your oldest purchased shares first, while LIFO (Last-In, First-Out) assumes you sell your most recently purchased shares first. FIFO typically results in lower capital gains in rising markets because older shares have lower cost bases. LIFO can reduce taxable gains in inflationary periods but is not permitted for mutual funds and is less commonly used for individual stocks.

How does FIFO affect my capital gains taxes?

Under FIFO, you sell the lowest-cost shares first, which maximizes your capital gains and tax liability in bull markets. For example, if you bought shares at $50, then $100, selling under FIFO means the $50 shares are sold first, generating a larger gain if the current price is $150. This method is straightforward but often results in higher taxes unless you've held shares for over one year for long-term capital gains treatment.

Can I use LIFO for mutual funds and ETFs?

No, the IRS does not permit LIFO accounting for mutual funds or ETFs; you must use FIFO, average cost, or specific identification. However, LIFO is allowed for individual stocks and some other securities. If you own mutual funds and attempt LIFO reporting, the IRS will disallow it and you may face penalties.

What is specific identification and when should I use it?

Specific identification allows you to choose exactly which shares you sell, giving you maximum control over your tax liability. This method is ideal when you have shares purchased at widely varying prices and want to optimize for tax efficiency. For instance, if you have shares bought at $50, $75, and $120, you can select which lot to sell to match your financial goals.

How do stock splits and dividends affect cost basis calculations?

Stock splits adjust your cost basis proportionally but don't change total invested capital; a 2-for-1 split halves your per-share basis. Reinvested dividends create new cost basis positions at the dividend payment date price, which must be tracked separately for accurate FIFO/LIFO calculations. Failure to account for these adjustments can lead to underreporting gains or overstating losses.

What happens if I don't track cost basis and use the calculator?

If you cannot locate original purchase records, the IRS allows you to use a reasonable estimate or the average closing price on the acquisition date as a fallback. However, using this calculator with estimated data may create discrepancies with your brokerage records and trigger audit risks. It's critical to obtain a Form 8949 from your broker, which lists all transactions with adjusted cost basis.

How do wash sale rules interact with FIFO cost basis calculations?

Under wash sale rules, if you sell a security at a loss and repurchase substantially identical shares within 30 days before or after, the loss is disallowed and added to the new shares' cost basis. A FIFO calculator doesn't automatically flag wash sales, so you must monitor your trades separately. For example, selling 100 shares at a $500 loss on December 15 and buying 100 shares on January 5 triggers a wash sale, increasing your new cost basis by $500.

What is the long-term vs. short-term capital gains treatment in cost basis calculations?

Assets held over one year receive long-term capital gains rates (0%, 15%, or 20% federal in 2024), while those held one year or less face short-term rates matching your ordinary income tax bracket, up to 37%. Your cost basis calculator must track purchase dates to determine holding periods. A FIFO method selling shares purchased 18 months ago qualifies as long-term gains, significantly reducing your tax burden compared to short-term treatment.

How should I handle inherited shares and their stepped-up basis?

Inherited securities receive a stepped-up basis equal to fair market value on the date of death, not the original purchase price. Your cost basis calculator should use this stepped-up value, not the deceased owner's original cost basis. For example, if someone inherited shares worth $10,000 that originally cost $2,000, the new cost basis is $10,000, and gains are calculated from that higher baseline.

References & Resources

Last updated: April 2026

Important — Educational Use Only

This calculator is provided for educational and informational purposes only. The results are estimates based on the information you provide and should not be considered financial, legal, or professional advice.

No Warranty: SmartKitNow makes no warranties regarding the accuracy, completeness, or reliability of the calculations. Results may vary based on individual circumstances, market conditions, and other factors.

Professional Advice: Always consult with qualified professionals (financial advisors, accountants, attorneys, or other specialists) before making any important financial or legal decisions.

Limitation of Liability: SmartKitNow and its affiliates are not liable for any losses, damages, or consequences resulting from the use of this calculator or reliance on its results.

By using this calculator, you acknowledge that you have read and understood this disclaimer, and you agree to use the tool at your own risk. For personalized guidance tailored to your specific situation, please seek advice from a qualified professional in the relevant field.

📋Last updated: August 2026

Share This Page

Help others by sharing this page

Send Us a Suggestion

Have an idea? We'd love to hear from you!

0 / 500 characters

💡 Your feedback helps us improve SmartKitNow for everyone

💰You might also like

We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.Privacy Policy.