Layered Dion-Jacobson (DJ) and Ruddlesden-Popper (RP) hybrid perovskites are promising materials for optoelectronic applications due to their modular structure. To fully exploit their functionality, mechanical stimuli can be used to control their properties without changing the composition. However, the responsiveness of these systems to pressure compatible with practical applications (<1GPa) remains unexploited. Hydrostatic pressure is used to investigate the structure-property relationships in representative iodide and bromide DJ and RP 2D perovskites based on 1,4-phenylenedimethylammonium (PDMA) and benzylammonium (BzA) spacers in the 0-0.35GPa pressure range. Pressure-dependent X-ray scattering measurements reveal that lattices of these compositions monotonically shrink and density functional theory calculations provide insights into the structural changes within the organic spacer layer. These structural changes affect the optical properties; the most significant shift in the optical absorption is observed in (BzA)2 PbBr4 under 0.35GPa pressure, which is attributed to an isostructural phase transition. Surprisingly, the RP and DJ perovskites behave similarly under pressure, despite the different binding modes of the spacer molecules. This study provides important insights into how the manipulation of the crystal structure affects the optoelectronic properties of such materials, whereas the reversibility of their response expands the perspectives for future applications.