We describe an alternative approach to the analysis of gravitational-wave backgrounds, based on the formalism used to characterise the polarisation of the cosmic microwave background. In contrast to standard analyses, this approach makes no assumptions about the nature of the background and so has the potential to reveal much more about the physical processes that generated it. An arbitrary background can be decomposed into modes whose angular dependence on the sky is given by gradients and curls of spherical harmonics. We derive the pulsar timing overlap reduction functions for the individual modes, which are given by simple combinations of spherical harmonics evaluated at the pulsar locations. We show how these can be used to recover the components of an arbitrary background, giving explicit results for both isotropic and anisotropic uncorrelated backgrounds. We also find that the response of a pulsar timing array to curl modes is identically zero, so half of the gravitational-wave sky will never be observed using pulsar timing, no matter how many pulsars are included in the array. An isotropic, unpolarised and uncorrelated background can be accurately represented using only three modes, and so a search of this type will be only slightly more complicated than the standard cross-correlation search using the Hellings and Downs overlap reduction function. However, by measuring the components of individual modes of the background and checking for consistency with isotropy, this approach has the potential to reveal much more information. Each individual mode on its own describes a background that is correlated between different points on the sky. A measurement of the components that indicates the presence of correlations in the background on large angular scales would suggest startling new physics.