Experiments are carried out in supersonic flow past cavities (L/D = 1–3) to comprehend cavity oscillation from transverse to longitudinal mode. To characterize this, time-resolved schlieren images and unsteady pressure measurements are carried out. For L/D = 1, the cavity oscillation is in the transverse direction which is characterized by a single vortex along with low frequency oscillations. In the present studies, for the given length and depth, the L/D = 2 cavity shows both transverse and longitudinal mode of oscillations. This dual nature is ascertained through high-speed schlieren images and large rise in the fluctuating pressure. For L/D = 3, the cavity oscillation is in the longitudinal direction accompanied by low values of fluctuating pressure component and number of discrete modes/tones. Hence, it is believed that the transverse to longitudinal mode of cavity oscillation in the present studies occurs between L/D = 2 and 3. These cavities are driven by a thick shear layer where the vortex convection is found to be nonlinear. The comparison of dominant modes/tones with modified Rossiter and Handa relations indicates the necessity to develop a suitable model for transitional cavities. In-depth analyzes in terms of cross-correlation as well as wavelet transform divulge the basis that generates cavity modes/tones and mode switching phenomena, respectively.