Skip to content

How it’s calculated

Opening balances and cost basis

How the balances and basis you enter set taxable gains on later sales.

Updated

Where this happens in a plan year

2of 8 stages

  1. Events
  2. Growth (covered)
  3. Required
  4. Income
  5. Spending
  6. Cash flow
  7. Taxes (covered)
  8. Year end
On this page
  1. What the opening balance means
  2. Blank basis and entered basis
  3. How a sale’s gain is calculated
  4. What raises and lowers basis
  5. Updating balances later
  6. What isn’t modeled

The balance you enter for an account is its value on the plan’s start date, and the projection’s first year grows from there. For a taxable brokerage account you can also enter cost basis. CoastMath tracks basis as a single average: a sale realizes the gain share of the account, reinvested dividends and new deposits add basis, and price growth doesn’t.

Leave basis blank and CoastMath assumes the account has no embedded gain on the start date, so early sales are tax-free until the account grows.

With plan type Now (starts today), balances are as of today and the first year covers the rest of this calendar year. With Fixed date, they’re as of the start date you choose. Either way, enter current market value, not what you paid, and not net of the tax you’d owe on withdrawal. Contributions and withdrawals made earlier in the same tax year are already in the balance; enter them separately only so limits and taxes see them (see Your plan’s start date and first year).

Cost basis applies only to Taxable Brokerage accounts; tax-deferred and tax-free accounts don’t need it.

  • Blank: basis equals the opening balance. The account starts with no unrealized gain or loss, and later price growth builds a gain from there.
  • Entered: the amount is used as is. Zero means the whole balance is gain. More than the balance means an unrealized loss, and a sale realizes part of it.

Realized gain=Withdrawal×(1 − basis ÷ balance)

Basis then falls by the same share of the account that was sold.

Example: $20,000 sale from a $100,000 account with $60,000 basis
Balance$100,000
Cost basis$60,000
×Gain share, 1 − 60,000 ÷ 100,00040%
=Realized gain on $20,000$8,000
→Basis after the sale$60,000 × (1 − 20,000 ÷ 100,000)$48,000

Had the basis been $120,000, the same sale would realize a $4,000 loss. Losses offset gains, and unused losses carry forward. Every realized gain is taxed at long-term rates; see Capital gains, dividends and investment taxes.

  • Raises it dollar for dollar: surplus deposits, transfers in, and reinvested dividends, which are taxed in the year paid.
  • Leaves it alone: price growth.
  • Lowers it: each sale, by the share of the account sold.
Balance and cost basis of a $100,000 account with $60,000 basis
  • Balance
  • Cost basis
$0$50K$100K$150K$200K0246810

Price growth of 5% and a 2% dividend yield, no deposits or sales. The gap between the lines is unrealized gain.

Show data
Balance and cost basis of a $100,000 account with $60,000 basis
Years from startBalanceCost basis
0$100,000$60,000
1$107,000$62,000
2$114,490$64,140
3$122,504$66,430
4$131,080$68,880
5$140,255$71,501
6$150,073$74,307
7$160,578$77,308
8$171,819$80,520
9$183,846$83,956
10$196,715$87,633

Editing a balance resets that account’s starting point for the whole projection. It doesn’t record a sale or a contribution, so nothing is taxed or counted toward a limit.

Roth accounts keep a separate record of contributions and conversions for early withdrawals; see How each account type grows and is taxed.

Next in Accounts and savingContributions, employer match and limits