The grain packing texture of underground sandstone tends to be a major controlling factor in porosity loss during compaction when the effective stress and buried depth increase. However, existing models used to predict porosity loss during sandstone compaction mostly disregard the grain packing texture of sandstone. Based on the micromechanical parameters of discrete element method (DEM) numerical simulation reported in literature, we designed one-component, binary, and ternary packing textures with different grain size distributions and subsequently performed compaction under triaxial servo simulation. We monitored the porosity loss, grain displacement, and force acting on the grain contact point during compaction. Based on the packing texture in sandstone, we propose a new method that considers varying grain sizes, grain size contents, and packing texture types to determine porosity loss during compaction without grain crushing and plastic deformation. The applicability of the method under theoretical conditions was evaluated with 5, 31, and 53 types of one-component, binary, and ternary packing textures. The correlation coefficient between the predicted and simulated values of the void ratio change (△e) was 0.999 and 0.985 for the binary and ternary packing textures, respectively. The reliability of the proposed method was verified using nine groups of physical experimental data derived from literature. The results showed a correlation coefficient of 0.88 between the measured and predicted values of △e and porosity loss (△ϕ). Errors in physical experimental data were derived mainly from grain shape and the crushing of coarse grains. Although the predicted physical experimental data △e and △ϕ were inferior to DEM simulation data, our model was deemed reliable since it showed high correlation between predicted and measured values of △e and △ϕ. Furthermore, the proposed method characterized the influence of the micromechanical process of grain rotation and grain packing texture on reservoir quality during compaction, thereby establishing its importance in predicting reservoir quality of underground sandstone.