Tight sandstone gas is widespread in the middle and lower Permian Shan 1 and He 8 Members in the northwestern Ordos Basin. We have studied the diagenesis by means of many petrographic techniques and determined its important influence on reservoir quality. The quantitative characterization of porosity evolution is important when analyzing reservoir consolidation. We found that reservoir rock types are mainly sublitharenite, quartz arenite, and litharenite in the deltaic facies through petrological and mineralogical analyses. Metamorphic rock (quartzite), followed by volcanic rock, dominates the lithic fragment types. In the early diagenetic stage, the reservoirs mainly underwent intensive compaction, hydrolysis, and alteration of volcanic debris. Sandstones in the middle diagenesis stage were characterized by quartz overgrowth, volcanic debris dissolution, cementation, and calcite and kaolinite replacement. Based on the formula from Beard and Weyl, we calculated that the original porosity of tight gas sandstones was 38.61%. The porosity loss during compaction was 26.64%; by cementation, it was 11.46%; and carbonate, siliceous, and authigenic clay cements accounted for 1.31%, 3.61%, and 6.44% loss in porosity, respectively. Dissolution was relatively weak, with an average increase in porosity of 4.86%, whereas the present porosity is 7.47%. We observed that the pore types in the study area are composed of intragranular dissolution pores and kaolinite intercrystalline pores, followed by residual primary pores and intergranular dissolution pores. However, microcracks were not common. Based on the results of the rate-controlled mercury intrusion, the pore diameters in different samples are similar but there were clear differences in the throat diameters. Nuclear magnetic resonance results indicate that the cutoff value is 13 ms with the movable fluid mainly distributed in larger pores. As the pressure increased, fluid in the larger pores was discharged in large quantities but there was no discharge of nonmovable fluid in the small pores. We conclude that intensive diagenetic transformation was the main cause of reservoir consolidation and multistage cementation resulted in a complicated pore-throat network and reduced reservoir permeability.