We study the thermal annealing effect of poly(methyl methacrylate) (PMMA) nanofibers made from anodic aluminum oxide (AAO) templates and their transformation to PMMA nanospheres. The PMMA nanofibers are prepared by wetting an AAO template with a 30 wt % PMMA solution, followed by the evaporation of the solvent. After the AAO template is removed by a weak base, the PMMA nanofibers are thermally annealed in ethylene glycol, a nonsolvent for PMMA. The surfaces of the nanofibers undulate and transform into nanospheres, driven by the Rayleigh instability. The driving force for the transformation process is the minimization of the interfacial energy between PMMA nanofibers and ethylene glycol. The transformation times at higher annealing temperatures are shorter than those at lower annealing temperatures. This study provides a facile route to prepare polymer nanospheres which are not accessible by other traditional methods.