Abstract Gray mold caused by Botrytis cinerea (Pers.) is the most economically important postharvest disease of fruit and vegetables at harvest and during storage. Therefore the current study was conducted to investigate the effectiveness of chitosan with different molecular weights on gray mold in vitro and in vivo in tomato fruit ( Solanum lycopersicum L. var. lycopersicum) stored at different temperatures. In an in vitro experiment, the results demonstrated that the antifungal activity increased as the chitosan molecular weight decreased. In an in vivo study, chitosan treatments significantly reduced fungal decay and all compounds with concentrations of 2000 and 4000 mg/L showed complete control of the fungus in wound-inoculated fruit. Chitosan with a molecular weight of 5.7 × 10 4 g/mol was the most effective compound among those tested. The results also revealed that high chitosan concentrations correlated with low disease incidence regardless of storage conditions. In addition to the antifungal activity, chitosan had the potential for the elicitation of defense markers, including total soluble phenolic compounds, polyphenoloxidase (PPO) activity and total protein content. Chitosan treatment decreased the activity of PPO and enhanced total protein and phenolic compounds in wounded tomato fruit. These findings suggest that the effects of chitosan with different molecular weights on gray mold in tomato fruit may be associated with direct fungitoxic properties against the pathogen, and the elicitation of biochemical defense responses in fruit.