Foamed concrete’s unique mesoscale porous structures influence its mechanical performance. This study adopted peridynamics method to build the three-dimensional (3-D) porous structure of a foamed cement paste specimen. The numerical model was verified through a comparison with the experimental results. Based on the model validation, a series of models were established to investigate the influence factors of porosity and void shape on the mechanical performance of foamed cement paste under uniaxial compression. The porosity was ranged from 10% to 70%, and the sphericity of a single void was ranged from 0.6 to 1.0. The results showed that the mechanical properties, including modulus, peak strength and fracture energy, decreased with the increase of porosity, while increased with the increase of void sphericity. Significant heterogeneity was noted among the models with the same porosity, as the void sphericity could cause a different wall thickness between voids. The internal stress could easily cause a damage to a local area with thin wall thickness, leading to weakening the mechanical performance of foamed cement paste.