Sponsored
Ad slot is loading...

Stock Cost Basis Calculator

Calculate cost basis using Average Cost, FIFO, or LIFO methods. Compare realized/unrealized gains across methods for optimal tax planning.

Transaction History

Enter buy/sell transactions with date, shares, price, and commission. Format as JSON array.
Average: simple, FIFO: oldest shares first, LIFO: newest shares first.

Current Position

Position Summary

Total Shares Bought:225
Total Shares Sold:150
Remaining Shares:75
Current Value:$4350.00
Total Commissions:$25.00

Average Cost Method

Avg Cost Per Share:$50.51
Remaining Cost Basis:$3788.33
Realized Gain:$1413.33
Unrealized Gain:$561.67
Total Gain:$1975.00

FIFO Method (First In, First Out)

Remaining Cost Basis:$3605.00
Realized Gain:$1230.00
Unrealized Gain:$745.00
Total Gain:$1975.00

LIFO Method (Last In, First Out)

Remaining Cost Basis:$3753.75
Realized Gain:$1378.75
Unrealized Gain:$596.25
Total Gain:$1975.00

Method Comparison

FIFO vs Avg:$-183.33
LIFO vs Avg:$-34.58
FIFO vs LIFO:$-148.75
Positive = FIFO/LIFO shows higher gain. Choose method that minimizes taxable gain (or maximizes loss).

Remaining Purchase Lots (FIFO View)

Purchase DateSharesPriceCostHolding DaysTerm
2024-02-1075$48.00$3600.00801Long-Term

Cost Basis Method Rules

  • Average Cost: Simple calculation. Total cost ÷ total shares. Only allowed for mutual funds. NOT allowed for individual stocks.
  • FIFO: Default for most brokerages. Oldest shares sold first. Often results in long-term gains (lower tax rate) if holding long.
  • LIFO: Newest shares sold first. May realize short-term gains (higher tax) or current losses. Can be strategic for tax-loss harvesting.
  • Specific Identification: Choose exactly which lot to sell. Must identify shares at time of sale. Most flexible for tax optimization.
  • IRS Requirement: Method must be chosen at time of sale. Cannot change retroactively. Keep records of method used for each sale.
  • Mutual Funds: Can use average cost. Once used, must continue for that fund. Can switch to FIFO/specific ID if never used average.
  • Broker Reporting: Brokers report cost basis to IRS on 1099-B since 2011. Verify broker's method matches your records.

Tax Strategy Tips

  • Long-Term Preferred: 15-20% vs 22-37% tax. FIFO often qualifies more sales as long-term.
  • Tax-Loss Harvesting: Sell losing positions to offset gains. LIFO may show current losses while FIFO shows old gains.
  • Wash Sale Rule: Cannot repurchase same stock within 30 days. Disallowed loss adds to new cost basis.
  • Gains vs Losses: Sell gains in low-income years (0% rate possible). Sell losses in high-income years (offset at marginal rate).
  • Commission Included: Cost basis includes purchase commission. Sale proceeds reduced by sale commission.
  • Dividend Reinvestment: DRIP purchases create new lots with new cost basis. Track each DRIP purchase separately.
Sponsored
Ad slot is loading...