We present a homogeneous X-ray analysis of all 318 gamma-ray bursts detected by the X-ray telescope (XRT) on the Swift satellite up to 2008 July 23; this represents the largest sample of X-ray GRB data published to date. In Sections 2–3, we detail the methods which the Swift-XRT team has developed to produce the enhanced positions, light curves, hardness ratios and spectra presented in this paper. Software using these methods continues to create such products for all new GRBs observed by the Swift-XRT. We also detail web-based tools allowing users to create these products for any object observed by the XRT, not just GRBs. In Sections 4–6, we present the results of our analysis of GRBs, including probability distribution functions of the temporal and spectral properties of the sample. We demonstrate evidence for a consistent underlying behaviour which can produce a range of light-curve morphologies, and attempt to interpret this behaviour in the framework of external forward shock emission. We find several difficulties, in particular that reconciliation of our data with the forward shock model requires energy injection to continue for days to weeks.