The present work examines the influence of sidewall boundary conditions, free stream Mach numbers, and Reynolds numbers on open rectangular cavity flows. Three-dimensional direct numerical simulations and large eddy simulations are performed for open cavity flows with length-to-depth ratio L/D = 6, width-to-depth ratio of W/D=1 and 2 for Reynolds number of RenD = 500 and 104. To numerically examine the effects of cavity width on the flows, we consider (1) two-dimensional cavities with spanwise periodicity and (2) finite-span cavities with no-slip adiabatic walls. Furthermore, the analyses are conducted for subsonic (M∞ = 0.6) and supersonic (M∞ = 1.4) speeds to reveal compressibility effects on the base flow. Companion experiments are carried out for sidewall-to-sidewall and finite-span cavities in the subsonic and supersonic wind tunnels at similar operating conditions but with ReD ~ 105. We find that at low ReD, widening the cavity can decrease the velocity fluctuations of the flow by introducing spanwise variations in the shear layer to reduce the kinetic energy from spanwise vortices associated with Rossiter modes. For turbulent flows at M∞ = 0.6 and 1.4, the spanwise variations in the flow fields are also captured, but the influence of cavity width on velocity fluctuations is moderate, as the dominant span-wise fluctuation is triggered from turbulent mixing. However, both velocity and pressure fluctuations decrease in the finite-span cavity compared to the spanwise periodic cavity.