Publication 17
taxmap/pub17/p17-051.htm#en_us_publink1000171810Before you can figure how much, if any, of a distribution from
your pension or annuity plan is taxable, you must determine your cost (your
investment in the contract) in the pension or annuity. Your total cost in the
plan includes the total premiums, contributions, or other amounts you paid. This
includes the amounts your employer contributed that were taxable to you when
paid. Cost does not include any amounts you deducted or were excluded from your
income.
From this total cost, subtract any refunds of premiums, rebates,
dividends, unrepaid loans that were not included in your income, or other
tax-free amounts that you received by the later of the annuity starting date or
the date on which you received your first payment.
Your annuity starting date is the later of the first day of the
first period for which you received a payment, or the date the plan's
obligations became fixed.
taxmap/pub17/p17-051.htm#en_us_publink1000171811Your cost in these accounts is your designated Roth contributions
that were included in your income as wages subject to applicable withholding
requirements.
taxmap/pub17/p17-051.htm#en_us_publink1000171812If you worked in a foreign country and contributions were made
to your retirement plan, special rules apply in determining your cost. See
Publication 575.