In the article, a silane film on the surface of Q235 steel was successfully prepared using 3-mercaptopropyltrimethoxysilane. The film-forming mechanism and anti-corrosion properties of the silane film on Q235 steel in a 3.5 wt.% NaCl solution were investigated using electrochemical measurements, surface analysis and theoretical calculations. The results indicated that the prepared silane film could effectively suppress the corrosion of Q235 steel, and its highest corrosion inhibition efficiency was 98.64% when the film was cured at 140°C for 60 minutes. That could be explained that the silane film was predominantly bonded to the steel surface through forming Si-O-Fe bond, accompanying a crosslinked Si-O-Si network structure formed during the curing process, which effectively reduced the dissolution of iron, thereby significantly enhancing the corrosion resistance of Q235 steel. In addition, the silane film possessed excellent hydrophobic properties caused by the long-chain alkyl group, preventing the penetration of corrosive medium.