Cost Basis Explained: Calculating Your Real Profit or Loss

Learn how cost basis works, why it matters for taxes, and how to track it properly across multiple purchases and broker transfers.

Cost Basis Explained

Key Takeaways

Why Cost Basis Actually Matters

Buy at €50, sell at €70. Your profit is €20 per share. That €50 is your cost basis.

Without it, you can’t calculate real returns. A stock at €100 could be a 50% gain or a 10% loss depending on what you paid. Cost basis is what makes profit real rather than hypothetical.

For taxes, cost basis is everything. Sell above cost basis and you have a capital gain (taxed). Sell below and you have a capital loss (which might reduce your tax bill elsewhere). The tax office absolutely cares about this number. Get it wrong and you either overpay or face penalties.

How to Calculate It

Single purchase? Easy. Price times shares plus fees. €50 per share, 10 shares, €10 fee equals €510 total. Divide by 10 shares for a €51 cost basis per share.

Multiple purchases at different prices? You need an average. This is normal with regular investing. You buy €100 worth in month one at €40/share (2.5 shares), then €100 in month two at €60/share (1.67 shares). Total: €200 for 4.17 shares. Average cost basis: €48 per share.

Most brokers calculate this automatically. But if you transfer between brokers, things can get lost. The new broker sometimes doesn’t have the full history. Worth tracking yourself to verify the numbers.

Different Methods for Selling

When selling only some shares, you need to decide which ones. The method you choose affects your taxes.

Average cost is the most common for ETFs and funds. All shares treated as having the same average cost, whether you bought them at the peak or the bottom. Simple and straightforward.

FIFO (First In, First Out) assumes oldest shares sell first. Default in many countries and many brokers. If you bought early and prices rose, FIFO means you sell the lowest-cost shares first, creating a larger gain and higher taxes.

Specific identification lets you pick exactly which shares to sell. Most control, most record-keeping. You might choose to sell higher-cost shares first, lowering your taxable gain. Requires documentation but offers tax efficiency.

Which method you use affects taxes significantly. Selling higher-cost shares first means lower taxable gains. Check your local rules before you sell, not after.

Things That Change Your Cost Basis

Stock splits are confusing but don’t change total cost basis. A 2-for-1 split means twice the shares at half the cost each. Your total invested amount stays the same.

Reinvested dividends create new shares with their own cost basis. If you reinvest dividends, each reinvestment is a separate purchase at a new price. Track these carefully.

Some distributions are return of capital. These lower your cost basis instead of being taxed as income. Rare, but they happen with certain types of investments.

Fees and trading costs can be added to your basis, reducing your taxable gain later. Some brokers do this automatically, others don’t. Verify.

Keeping Track

Save your purchase confirmations. Save dividend reinvestment records. Your broker tracks this, but mistakes happen. A spreadsheet with purchase dates, prices, and quantities takes 10 minutes and saves hours of confusion later.

Transferring between brokers is where cost basis often gets lost. Make sure it comes with you. Sometimes it doesn’t. Call your new broker and get the full history. If they don’t have it, ask the old broker for records and provide them yourself.

Gallio tracks cost basis for you, showing your real returns at a glance. But keep your own records even if your broker does. You’re responsible for accurate tax reporting, not them.

The Bottom Line

Cost basis is boring accounting but it determines both your real returns and your tax bill. Track it from the beginning. Save your records. Verify your broker’s calculations. When it comes time to sell, know what method you’re using and why.


Gallio automatically tracks your cost basis and real returns, so you know exactly where you stand without digging through old confirmation emails and spreadsheets.