ABSTRACT The outflow structures of gamma-ray bursts (GRBs) can provide insights into the origins and radiation mechanisms of these cosmic explosions. We systematically study the GRB outflow structures by modelling their afterglow light curves and check if the structures of long gamma-ray bursts (LGRBs) and short gamma-ray bursts (SGRBs) are different. The sample consists of Swift-XRT afterglows with sufficient coverage and known redshift, which includes 195 well-fit LGRBs and 13 well-fit SGRBs. The model we use is a two-parameter ‘boosted fireball’ model, which consists of a family of outflows, with shapes varying smoothly from a quasi-spherical outflow to a highly collimated jet. We use the jetfit package to fit afterglow light curves and obtain the jet parameters. We find that there are no statistical differences in the distributions of jet parameters between LGRBs and SGRBs by performing K–S test and 74 per cent of the ratios of the observer angle to jet opening angle are in the range of 0.2 to 1. Our analysis indicates that the majority of GRB afterglows are viewed off-axis and there has no statistical difference between LGRBs and SGRBs. We also find that both the LGRBs and SGRBs exhibit two similar correlations: the jet opening angle is positively correlated with the observer angle, with the correlation coefficient 0.61 for LGRBs and 0.63 for SGRBs; the circumburst density is inversely correlated with the explosion energy with the correlation coefficient −0.89 for LGRBs and −0.69 for SGRBs. Our results suggest that the outflow structures are similar for the LGRBs and SGRBs.