What Is Cost Basis?

Light bulb icon.

Quick Answer

Your cost basis is the original price you paid for a stock, fund or other investment. It's used to calculate your gain or loss when you sell, as well as your potential tax bill.

Shot of a young businesswoman using a laptop at her desk in a modern office

When you sell an investment or a home, you may owe capital gains tax on the profit. Your cost basis is the original price you paid for the asset, and it's one of the key factors in figuring out how much you owe. Knowing how cost basis works and how to calculate it can help you plan ahead and avoid surprises at tax time.

What Is Cost Basis?

Your cost basis on an investment is the original price you paid for the shares of stock or other security you purchased. With a stock, that includes the price per share at the time of purchase plus any brokerage commissions or other transaction fees. With mutual funds, it also includes any upfront load fees.

With a home, cost basis works a bit differently. It starts with what you paid for the property, but you can also add certain costs over time, like major home improvements and money spent to repair damage.

When you sell, you subtract your cost basis from the sale proceeds to determine your gain or loss. That figure is then used to calculate any capital gains tax you may owe.

Invest Your Money Smarter

Browse top brokerages

Find a brokerage to start investing today. Compare offers with sign up bonuses and low or no fees.

Why Is Cost Basis Important?

Cost basis matters because it directly affects how much tax you owe when you sell an investment or a home. Without it, you can't accurately calculate your gain or loss on a sale.

If your cost basis is high relative to your sale price, your taxable gain is small. You may even have a loss, which can offset other gains.

On the flip side, if your cost basis is low, you may owe more in taxes. Tracking it carefully also protects you from overpaying. If you don't account for all eligible costs, you could end up reporting a larger gain than you actually had.

How to Calculate Cost Basis

The process for calculating cost basis differs, depending on whether you're dealing with investments or real estate.

Cost Basis for Investments

There are three main methods for calculating cost basis on investment securities:

  • First-in, first-out (FIFO): The default method at most brokerage firms (except for mutual funds), FIFO assumes that when you sell a portion of your position, you're selling your oldest shares first. If those earlier shares had a lower purchase price, this can result in a larger taxable gain.
  • Specific identification: This method lets you choose which shares to sell based on their individual cost basis. By selecting shares with a higher purchase price, you can reduce your taxable gain on the sale. You'll need to instruct your broker to use this method rather than the default.
  • Average cost, single category: The default method for mutual fund shares, this approach averages the cost of all shares you own, then multiplies that average by the number of shares you're selling.

Cost Basis for a Home

To calculate the cost basis for real estate, you'll start by adding common costs like:

  • The original purchase price of the home
  • Eligible settlement fees and closing costs
  • Major home improvements
  • Costs to repair damage to the home and property

Then, you'll subtract certain expenses, such as:

  • Allowable depreciation for business or rental purposes
  • Casualty losses
  • Insurance payments for casualty losses
  • Energy credits and subsidies

Keep in mind, though, that the IRS provides an exclusion for capital gains tax for taxpayers who resided in the home for at least two out of the previous five years. More specifically, you may be able to exclude up to $250,000 in capital gains (or $500,000 if you're married and filing jointly).

Learn more: How to Sell Your House: A Step-by-Step Guide

Examples of Cost Basis

Depending on the type of asset you own, here are some examples of how you might calculate the cost basis.

FIFO Method vs. Specific Identification Method

Let's say you've purchased shares of ABC company in the following intervals:

  • 10 shares at $10 per share
  • 15 shares at $12 per share
  • Five shares at $14 per share

The price has since jumped to $20, and you want to sell five shares, netting $100. Using FIFO, your cost basis would be $50 (five shares at $10), leaving you with a taxable gain of $50.

With specific identification, you could instruct your broker to sell the five shares you bought at $14 each, giving you a cost basis of $70 and a taxable gain of only $30.

Average Cost, Single Category Method

Let's say you've purchased 100 shares of a mutual fund at various times, with an average cost per share of $65. If you sell 20 shares at $75 each for $1,500, your cost basis is $1,300 (20 shares x $65 average). Your taxable gain would be $200.

Real Estate Method

Say you bought a home for $200,000 and later sold it for $300,000. Over the years, you spent $20,000 on improvements and repairs, but received $5,000 in insurance payouts for losses.

Your cost basis would be $215,000 ($200,000 + $20,000 - $5,000), leaving you with a gain of $85,000—well below the exclusion amount if you meet the residency requirements.

Frequently Asked Questions

If you're thinking about selling stock that was gifted to you, your cost basis depends on the original price the gifter paid and the fair market value (FMV) of the shares when you received them.

If the FMV at the time of the gift was higher than the original purchase price, your cost basis is the original price. But if the FMV was lower than the original purchase price, your cost basis depends on what happens when you sell.

Calculating Cost Basis of Gifted Stocks
Stock Price at the Time of SaleCost Basis
Higher than the original priceThe original price
Higher than the FMV at the time of the gift but lower than the original priceYour selling price
Lower than the FMV at the time of the giftThe FMV at the time of the gift

When calculating the cost basis for a home, you can generally add the following:

  • The amount you paid for the home, including your down payment and any mortgage amount
  • Settlement fees paid at closing (excluding financing costs)
  • Real estate taxes paid on behalf of the seller that weren't reimbursed to you
  • Costs related to construction or improvements that are still part of the home at the time of sale
  • Money spent to repair damage to the home or the land it sits on
  • Special assessments for local improvements

A step-up in basis is an IRS rule that resets the cost basis of an inherited asset to its fair market value on the date of the original owner's death. This can significantly reduce capital gains taxes for heirs.

Example:If someone bought stock for $10 per share and it was worth $80 per share when they died, the heir's cost basis would be stepped up to $80, not $10. If the heir then sells at $85 per share, they'd only owe tax on a $5 gain rather than a $75 gain.

When you sell investments in a taxable brokerage account, your broker reports your cost basis to the IRS on Form 1099-B.

For securities purchased before mandatory reporting began (phased in 2011 to 2014), your broker may not report your basis. However, you're still responsible for accurately reporting gains and losses. For real estate, sale information is reported to the IRS on Form 1099-S.

The Bottom Line

Managing taxes on an investment portfolio or a home sale can be complicated, but understanding how to calculate your cost basis and gain can help you better estimate what your tax bill might look like.

If you're overwhelmed by the prospect of calculating cost basis on your own, consult with a tax professional who can provide personalized guidance for your situation.

What makes a good credit score?

Learn what it takes to achieve a good credit score. Review your FICO® Score for free and see what’s helping and hurting your score.

Get your FICO® Score

No credit card required

Promo icon.

About the author

Ben Luthi has worked in financial planning, banking and auto finance, and writes about all aspects of money. His work has appeared in Time, Success, USA Today, Credit Karma, NerdWallet, Wirecutter and more.

Read more from Ben

Explore more topics

Share article

Experian app.

Download the free Experian appCarry trusted financial tools with you

Download from the Apple App Store.Get it on Google Play.
Experian's Diversity logo.

Experian’s Inclusion and BelongingLearn more how Experian is committed