Hal_Al
Level 15

Retirement tax questions

The 10% penalty applies only to the earnings (capital/investment gains only). 

The plan administrator is required to keep track of that. When you take a distribution, the plan will issue an IRS form 1099-Q to report on your tax return. Box 1 will have the total distribution and box 2 the earnings.

If you do not take all your money out, the amount you do take out will be prorated between earnings and basis (contributions). That is, you are not allowed to pull out your contributions, first.