529 earnings are shown in
Box 2 of your
1099-Q. The earnings are the amount of interest income, dividend income, capital gains, etc., that your original investment in the 529 plan has earned over the years.
You can't claim a loss (negative earnings) unless this is your final distribution. If
Box 2 is negative and it's not your final distribution, enter zero.
How much of my Form 1099-Q income is taxable?