As a new feed additive, chitosan has been shown in recent years to have a certain role in reducing methane emissions from the gastrointestinal tracts of ruminants. However, the effects of chitosan with different molecular weights on rumen fermentation, methane production and bacterial community structure are not yet clear. A basal diet without chitosan served as the control (CTL), and the treatment diets were supplemented with chitosan with different molecular weights: 1 000 (1K), 3 000 (3K), 5 000 (5K), 50 000 (5W) and 200 000 (20W) dry matter (DM). Six fermentation units per treatment were established. Gas chromatography was used to measure the concentrations of methane, H2 and volatile fatty acids (VFAs). The bacterial 16S rRNA genes were sequenced with an Illumina MiSeq platform and analysed to reveal the relative abundances of bacterial community taxa. The results showed that the propionate proportion was significantly increased by the addition of chitosan with different molecular weights (P<0.05), while methane production and the acetate proportion were significantly decreased (P<0.05). The relative abundances of Rikenellaceae_RC9_gut_group and Prevotellaceae_UCG_003 were significantly increased in the 3K chitosan group compared with the CTL group, whereas the relative abundance of Ruminococcaceae_NK4A214_group was significantly decreased (P<0.05). Correlation analyses of the relative abundances of the bacterial genera showed that Prevotella was positively related to propionate production (P<0.05). In conclusion, 3K chitosan could reduce methane production by replacing fibrolytic bacteria (Firmicutes and Fibrobacteres) with amylolytic bacteria (Bacteroidetes and Proteobacteria) in the bacterial community structure.