We investigate the dependence of galaxy clustering on luminosity and spectral type using the 2dF Galaxy Redshift Survey (2dFGRS). Spectral types are assigned using the principal-component analysis of Madgwick et al. We divide the sample into two broad spectral classes: galaxies with strong emission lines ('late types') and more quiescent galaxies ('early types'). We measure the clustering in real space, free from any distortion of the clustering pattern owing to peculiar velocities, for a series of volume-limited samples. The projected correlation functions of both spectral types are well described by a power law for transverse separations in the range 2 < (σ/h-1 Mpc) < 15, with a marginally steeper slope for early types than late types. Both early and late types have approximately the same dependence of clustering strength on luminosity, with the clustering amplitude increasing by a factor of ∼2.5 between L* and 4L*. At all luminosities, however, the correlation function amplitude for the early types is ∼50 per cent higher than that of the late types. These results support the view that luminosity, and not type, is the dominant factor in determining how the clustering strength of the whole galaxy population varies with luminosity.