Cost Basis Calculator (USA)

Calculate cost basis for your investments to track gains/losses for tax purposes. Includes purchase price, commissions, and fees.

How to Calculate Cost Basis

Cost basis is the original value of an asset for tax purposes:

\[\text{Cost Basis} = \text{Purchase Price} + \text{Commissions} + \text{Fees}\]

Where:

  • Purchase Price: Price paid for the investment
  • Commissions: Brokerage fees for the transaction
  • Fees: Additional costs associated with the purchase
  • Cost Basis: Total investment cost for tax calculations

The cost basis is used to calculate capital gains or losses when selling investments.

Calculate Cost Basis

Total Cost Basis

$0.00

N/A

Purchase Price

$0.00

N/A

Commissions

$0.00

N/A

Total Fees

$0.00

N/A

Status: Enter transactions to calculate

Cost Breakdown

Cost Composition
Purchase: 0% Commissions: 0% Fees: 0%

Investment Details

Component Amount Description

Tax Implications

Capital Gains Calculation
Sell price - Cost basis = Capital gain/loss
Short-term Rate
Up to 37% (held ≤1 year)
Long-term Rate
0%, 15%, or 20% (held >1 year)
Wash Sale Rule
Applies if repurchased within 30 days

Tax Planning Recommendations

Based on your cost basis: Enter transactions to get recommendations

  • Enter your investment transactions to see tax planning recommendations

Understanding Cost Basis

Definition

Cost basis is the original value of an asset for tax purposes, usually the purchase price plus any commissions and fees. It's used to calculate capital gains or losses when selling investments.

Calculation Method

The cost basis is calculated using the formula:

\[\text{Cost Basis} = \text{Purchase Price} + \text{Commissions} + \text{Fees}\]

For multiple purchases of the same security, the average cost basis is:

\[\text{Average Cost Basis} = \frac{\text{Total Cost of All Purchases}}{\text{Total Number of Shares}}\]

Important Rules

  • Cost basis affects capital gains taxes
  • Include all purchase-related costs
  • Keep detailed records for tax purposes
  • Consider wash sale rules when selling
  • Account for stock splits and dividends
TIP: Keep detailed records of all investment transactions
TIP: Track cost basis separately for each lot of shares
TIP: Consider tax-loss harvesting opportunities

Test Your Knowledge

Question 1: Cost Basis Calculation

If you purchased 100 shares at $50 per share with a $10 commission, what is your cost basis?

Solution:

Answer: b) $5,010

Cost Basis = Purchase Price + Commissions + Fees

Cost Basis = (100 × $50) + $10 + $0 = $5,000 + $10 = $5,010

Learning Objective:

Understand the basic calculation for cost basis using the formula.

Rule:

Cost Basis = Purchase Price + Commissions + Fees

Tip:

Always include all transaction costs when calculating cost basis.

Question 2: Average Cost Basis

You bought 100 shares at $40 and later 100 shares at $60. What is your average cost basis per share?

Solution:

Total cost: (100 × $40) + (100 × $60) = $4,000 + $6,000 = $10,000

Total shares: 100 + 100 = 200 shares

Average cost basis: $10,000 ÷ 200 = $50 per share

Learning Objective:

Learn to calculate average cost basis for multiple purchases.

Pedagogy Note:

Average cost basis is calculated by dividing total cost by total shares.

Question 3: Tax Implications

Which of the following is NOT included in cost basis?

Solution:

Answer: c) Annual maintenance fees

Cost basis includes purchase price, commissions, and transaction fees, but not recurring maintenance fees.

Common Mistake:

Including ongoing maintenance fees in cost basis when only transaction costs should be included.

Question 4: Wash Sale Rule

You sell 100 shares of XYZ stock for $40 per share (cost basis $50 per share) and buy 100 shares of XYZ stock 20 days later at $35 per share. How does the wash sale rule apply?

Solution:

You have a $10 per share loss ($40 - $50), but because you repurchased the same stock within 30 days, the wash sale rule applies. You cannot deduct the $1,000 loss. Instead, you add it to the cost basis of the new shares: $35 + $10 = $45 per share new cost basis.

Tip:

Plan your buying/selling schedule carefully to avoid wash sale complications.

Question 5: Record Keeping

Explain the importance of tracking cost basis for tax purposes and the potential consequences of inaccurate records.

Solution:

Accurate cost basis tracking is crucial for calculating correct capital gains taxes. Without proper records:

  • You may overpay taxes by underestimating your cost basis
  • You may face penalties for incorrect reporting
  • You lose the ability to harvest tax losses
  • IRS audits become more challenging

Keep detailed records of all transactions including dates, prices, commissions, and fees.

Learning Objective:

Understand the tax implications of accurate cost basis tracking.

Q&A

Q: What methods can I use to calculate cost basis for multiple purchases of the same stock?

A: There are several methods to calculate cost basis for multiple purchases:

Specific Identification:

  • Choose which specific shares to sell
  • Requires detailed records of purchase dates and prices
  • Allows tax optimization (selling high-basis shares first)
  • Must be designated at time of sale

Average Cost Method:

  • Average total cost across all shares
  • Simple to calculate
  • Available for mutual funds
  • Not available for stocks in all brokerages

First-In, First-Out (FIFO):

  • Sells oldest shares first
  • Default method if no election made
  • Often results in higher gains for older holdings
  • Automatic and requires no special designation

Check with your brokerage to see which methods they support.

Q: How do dividends and stock splits affect cost basis?

A: Corporate actions affect cost basis calculations:

Stock Splits:

  • Adjust cost basis proportionally
  • Example: 2-for-1 split halves per-share basis
  • Number of shares doubles, total basis stays same
  • Recalculate for all shares affected

Reverse Splits:

  • Adjust cost basis proportionally
  • Example: 1-for-2 reverse doubles per-share basis
  • Number of shares halves, total basis stays same

Stock Dividends:

  • Allocate total basis between old and new shares
  • Calculate based on fair market value
  • Treat as return of capital
  • Adjust basis accordingly

Spin-offs:

  • Allocate basis between parent and spin-off stock
  • Based on relative fair market values
  • Keep records of allocation method

Always adjust cost basis when corporate actions occur to maintain accurate records.

About

Finance Tools Team
This calculator was created by our Finance & Salary Team , may make errors. Consider checking important information. Updated: April 2026.