Years ago (2000 and 2001) I contributed a total of $4000 to a contribution Roth IRA ($2000 in each year). The contributions were made in post-tax money as required. I never contributed any additional money to the Roth, which was invested in mutual funds. Eventually, the Roth grew to $21,500, and in 2017 (when I was age 67) I withdrew the full amount. Based on my understanding of Roth IRAs, the full amount of my withdrawal should be tax-free.
But when I enter the information into my tax software, it comes up and asks me to enter my "basis in the Roth IRA contributions". I thought the "basis" would be the amount of my contributions, which would be $4000. But when I enter $4000, the software tells me I owe tax on $17,500, which is basically the earnings on the Roth. That can't be right, because as a taxpayer over
65 who had the Roth for 18 years, the full amount of the distribution should be tax-free. Am I misunderstanding the definition of "basis"?