Compaction bands are strain localization structures that are relatively impermeable and can act as barriers to fluid flow in reservoirs. Laboratory studies have shown that discrete compaction bands develop in several sandstones with porosities of 22–25%, at stress states in the transitional regime between brittle faulting and cataclastic flow. To identify the microstructural parameters that influence compaction band formation, we conducted a systematic study of mechanical deformation, failure mode and microstructural evolution in Bleurswiller and Boise sandstones, of similar porosity (∼25%) and mineralogy but different sorting. Discrete compaction bands were observed to develop over a wide range of pressure in the Bleurswiller sandstone that has a relatively uniform grain size distribution. In contrast, compaction localization was not observed in the poorly sorted Boise sandstone. Our results demonstrate that grain size distribution exerts important influence on compaction band development, in agreement with recently published data from Valley of Fire and Buckskin Gulch, as well as numerical studies.