Shear‐enhanced compaction in shallow sandstone reservoirs has been investigated in laboratory experiments using high‐pressure triaxial testing of poorly lithified sandstone and sand. We have studied the deformation mechanism involved during shear‐enhanced compaction and controlling parameters for yield stress at varying confining pressures for sandstone/sand with different grain sizes, porosities, and packing. Experimental testing provides insights into the deformation mechanism during hydrostatic and axial compression of coarse‐ and fine‐grained sands with different packing including (1) natural coarse‐grained sandstone, (2) densely packed fine‐grained sand, and (3) loosely packed fine‐grained sand. Monitoring of deformation and ultrasonic velocity during deformation indicates porosity loss, compaction, and strain hardening for most of the samples. Visualization of deformation using pretest and posttest X‐ray imaging and thin sections demonstrates localized deformation fabrics and grain damage. The results show grain rearrangement as the controlling deformation mechanism for material at low stress and high porosity, whereas for lower porosity and higher stress, grain fracturing controlled the deformation. The most pronounced localization of deformation was observed for the coarse‐grained, low‐porosity material. A Cam‐Clay cap model was used to describe the porosity loss during compaction and shear‐enhanced compaction, demonstrating large inelastic compaction with increasing confining pressure. Yield stress and end caps for poorly lithified sandstone are observed for various porosities and stress conditions and found to be lower than predicted using empirical relationships for sandstone.