ABSTRACTThe influence of in situ synthesized nanoparticles on the microstructure and compression properties of polymer foams during supercritical carbon dioxide foaming has been investigated. The in situ synthesized Ag nanoparticles were chosen to be heterogeneous nucleating agent. For achieving our target, the influence of the nanoparticle size on the cell structure and the nucleation mechanism has been detailed discussed firstly. The results show that the in situ synthesized nanoparticles can be heterogeneous nucleation agent to improve the cell density of the PMMA‐based foams. The particle size is able to reduce to the critical size of heterogeneous nucleation agent and, then, can highly improve the cell density of the foams. The Ag nanoparticles with average size of 2.2 nm led to 85% increase in compressive strength of the foams. The improvement of strength of the polymer matrix and the microstructure of the foams can lead to the remarkable increase in the mechanical properties of the foams. © 2016 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2017, 134, 44629.