According to the previous researches of sandstone, it was found that the key microscopic parameters influencing unconfined compressive strength (UCS) are porosity and grain area ratio (GAR). However, the relation of macroscopic properties with the microscopic ones highlights necessities further study in exploring how the microscopic properties influence the macroscopic properties. In this study, numerical analyses based on the bonded particle model were conducted to systematically study the microscopic mechanism. The model is firstly verified by simulating the variation of UCS with different GAR and porosity n. Furthermore, the elasto-plastic deformation of sandstone is explored by means of CTC tests. Analysis results demonstrate the mechanical behaviour of sandstone has the following characteristics: (1) The greater GAR and porosity will lead to the less cohesion, and the higher porosity leads to the lower friction angle; (2) The elastic shear modulus increases with decreasing porosity and increasing GAR; (3) A series of elliptic plastic potential surfaces can be observed; and (4) The variations of plastic angle and plastic strain trajectory under different shear stress are similar to actual behaviours of sandstone.