Cost Basis Calculator
Track adjusted cost basis through reinvested dividends, return of capital and stock splits, with basis per share and the unrealised gain on the position.
Total reinvested over the holding period. You already paid tax on these — they add to basis.
To show the unrealised position.
Reinvested dividends are the most commonly missed adjustment in the whole of personal tax. You paid income tax on them the year they were declared, so they add to basis — leave them out and you pay tax on the same $2,400 twice.
What this calculator does
Shares, purchase price, commissions, reinvested dividends and the shares they bought, return of capital, and any split ratio go in. It returns your initial cost, total adjusted basis, basis per share before and after the split, the current value of the position, the unrealised gain in dollars and percent, and the net gain if you sold today.
Basis is the least glamorous number in investing and the one that most often costs people real money by being wrong.
Why basis matters
When you sell, tax is owed on proceeds minus basis. Every dollar of basis you can document is a dollar that is not taxed.
So an understated basis is not a paperwork problem. It is a direct overpayment of tax, at your capital gains rate, on money you already paid tax on once. And because it happens silently — the broker reports a number, you enter it, the return is accepted — nothing ever tells you it went wrong.
Reinvested dividends: the expensive omission
If you take one thing from this page, take this.
You own a fund. It pays a dividend. You have reinvestment turned on, so instead of cash you get more shares. At the end of the year a statement arrives showing that dividend as taxable income, and you pay tax on it even though you never saw a dollar of it.
Those shares are yours, they were bought with money you have already paid tax on, and they have basis equal to what they cost.
Now sell twenty years later. If you report basis as only what you originally put in, every one of those reinvested dividends is counted as gain — and taxed a second time.
In the calculator’s default scenario, $2,400 of reinvested dividends adds $2,400 of basis. At a combined 20 percent rate, forgetting them costs $480 in tax that was never owed. Over decades in a dividend-paying fund the figure gets much larger, because reinvestment compounds.
This is the most common self-inflicted tax error in ordinary investing, and it is entirely a record-keeping problem.
Return of capital: the mirror image
Some distributions are not paid out of earnings. They are a return of your own money, and because it was never income, it is not taxed when you receive it.
Instead it reduces your basis. Which means the tax is not avoided — it is deferred until you sell, when the lower basis produces a larger gain.
REITs, some closed-end funds, master limited partnerships and funds in wind-down distribute return of capital routinely. It accumulates quietly over years, and an investor who has held a REIT for a decade can have a basis substantially below what they paid, with a correspondingly larger gain waiting.
Your annual tax documents identify how much of each distribution was return of capital. That is the number to enter.
Splits change per-share basis, not total basis
A 2-for-1 split doubles your share count and halves the price. Your position is worth exactly what it was worth the moment before.
Total basis is likewise unchanged. Basis per share halves.
100 shares at $50 basis each — $5,000 total. After the split: 200 shares at $25 basis each — still $5,000.
This trips people up because the per-share number they remember is suddenly wrong, and if they use it against the new share count they double their basis and understate the gain. The safe habit is to track total basis and derive per-share when needed, which is what this calculator does.
Reverse splits work identically in the other direction.
Do not trust the broker blindly
Since the cost-basis reporting rules took effect, brokers report basis for covered shares — generally those acquired after the applicable start date for that security type.
Everything else is frequently wrong or blank:
- Older lots acquired before the rules applied
- Transferred positions, where basis may or may not have followed the shares between firms
- Inherited shares, which generally receive a stepped-up basis at the date of death — a completely different number from what the deceased paid
- Gifted shares, which carry the giver’s basis, with a special rule if the position was at a loss when gifted
- Shares from employer plans, which have their own complications
When the broker’s number and your records disagree, your documented records are what settles it. Which is why a folder — even a rough one — is worth keeping for as long as you hold the position.
Which shares did you sell?
Not covered by this calculator, but worth knowing it exists.
If you bought the same security in several lots at different prices, which lot you sell changes the gain. The default is usually first-in-first-out, which in an appreciating position sells your cheapest shares and maximises the gain. Specific identification lets you choose — and choosing high-basis lots is one of the simplest tax reductions available.
The catch is that you generally have to identify the lot at the time of sale, not at filing. It is a decision with a deadline, and most brokerages let you set the method in advance.
What this leaves out
- Lot selection methods, as above.
- Wash sales, which disallow a loss when substantially identical securities are repurchased within a window — and add the disallowed loss to the basis of the replacement shares.
- Inherited step-up and gifted-share basis rules.
- Employer stock plans, ESPPs and equity compensation, each with their own basis mechanics.
- Bond premium and discount amortisation.
- Foreign currency and foreign tax credits.
Once you have basis, the capital gains estimator turns it into a tax figure at rates you supply, and the net worth calculator puts the position in context.
How this is calculated
initial cost = shares × price + commission basis = initial cost + reinvested dividends − return of capital basis per share = basis ÷ total shares after a split = basis ÷ (shares × split ratio) ← total basis unchanged
Frequently asked questions
- How do I calculate cost basis?
- Start with what you paid including commissions, add every reinvested dividend, and subtract any return-of-capital distributions. Divide by the total number of shares you now hold for basis per share. The reinvested dividends are the part people miss, and leaving them out means paying tax twice on the same money.
- Do reinvested dividends increase cost basis?
- Yes, and this is the single most commonly missed adjustment in personal tax. A reinvested dividend was taxable income in the year it was declared — you paid tax on it even though you never saw the cash. It bought more shares, and those shares have basis. Omit it and you pay tax on that same money again when you sell.
- What happens to cost basis after a stock split?
- Nothing, in total. A 2-for-1 split doubles your share count and halves the price, so the value of your position and your total basis are both unchanged. What changes is basis per share, which halves. If you owned 100 shares at $50 basis each, you now own 200 at $25 each.
- What is return of capital and how does it affect basis?
- A distribution that is not paid out of earnings, so it is not taxed as income when received. Instead it reduces your basis, which increases the gain when you eventually sell — the tax is deferred rather than avoided. REITs, some closed-end funds and partnerships distribute return of capital regularly, and it accumulates quietly over years.
- Does my broker track cost basis for me?
- For covered shares acquired after the reporting rules took effect, brokers report basis to you and to the tax authority. Older lots, positions transferred between brokerages, inherited shares and gifted shares are frequently wrong or simply blank. Your own records are what settles it, which is why they are worth keeping.