The linear stability of incompressible flows is investigated on the basis of the finite element method. The two-dimensional base flows computed numerically over a range of Reynolds numbers are perturbed with three-dimensional disturbances. The three-dimensionality in the flow associated with the secondary instability is identified precisely. First, by using linear stability theory and normal mode analysis, the partial differential equations governing the evolution of perturbation are derived from the linearized Navier–Stokes equation with slight compressibility. In terms of the mixed finite element discretization, in which six-node quadratic Lagrange triangular elements with quadratic interpolation for velocities (P2) and three-node linear Lagrange triangular elements for pressure (P1) are employed, a non-singular generalized eigenproblem is formulated from these equations, whose solution gives the dispersion relation between complex growth rate and wave number. Then, the stabilities of two cases, i.e. the lid-driven cavity flow and flow past a circular cylinder, are examined. These studies determine accurately stability curves to identify the critical Reynolds number and the critical wavelength of the neutral mode by means of the Krylov subspace method and discuss the mechanism of instability. For the cavity flow, the estimated critical results are Rec=920.277±0.010 for the Reynolds number and kc=7.40±0.02 for the wave number. These results are in good agreement with the observation of Aidun et al. and are more accurate than those by the finite difference method. This instability in the cavity is associated with absolute instability [Huerre and Monkewitz, Annu. Rev. Fluid Mech., 22, 473–537 (1990)]. The Taylor–Goertler-like vortices in the cavity are verified by means of the reconstruction of three-dimensional flows. As for the flow past a circular cylinder, the primary instability result shows that the flow has only two-dimensional characteristics at the onset of the von Karman vortex street, when Re<49. The estimated critical values of primary instability are Rec=46.389±0.010 and Stc=0.126 for the Strouhal number. These values are very close to the observation data [Williamson, J. Fluid Mech., 206, 579–627 (1989)] and other stability results [Morzynski and Thiele, Z. Agnew. Math. Mech., 71, T424–T428 (1991); Jackson, J. Fluid Mech., 182, 23–45 (1987)]. This onset of vortex shedding is associated with the symmetry-breaking bifurcation at the Hopf point. Copyright © 1999 John Wiley & Sons, Ltd.