This paper is devoted to the development of a parallel, spectral and second-order time-accurate method for solving the incompressible and variable density Navier–Stokes equations. The method is well suited for finite thickness density layers and is very efficient, especially for three-dimensional computations. It is based on an exact projection technique. To enforce incompressibility, for a non-homogeneous fluid, the pressure is computed using an iterative algorithm. A complete study of the convergence properties of this algorithm is done for different density variations. Numerical simulations showing, qualitatively, the capabilities of the developed Navier–Stokes solver for many realistic problems are presented. The numerical procedure is also validated quantitatively by reproducing growth rates from the linear instability theory in a three-dimensional direct numerical simulation of an unstable, non-homogeneous, flow configuration. It is also shown that, even in a turbulent flow, the spectral accuracy is recovered. Copyright © 2012 John Wiley & Sons, Ltd.