A flow sensor for pulmonary function testing is provided, and the flow sensor is capable of preventing cross-infection and has a hollow tubular structure. The flow sensor includes a main breather tube and a pressure tapping hole arranged on a tube wall of the main breather tube. An outer wall of the main breather tube is provided with a pressure tapping stub in air communication with the pressure tapping hole. The volume of an inner cavity of the pressure tapping stub satisfies following condition: during the pulmonary function testing, air exhaled or inhaled by a tester enters the pressure tapping stub through the pressure tapping hole and is kept within the pressure tapping stub without contacting a connection pipeline outside of the flow sensor. The flow sensor can isolate contaminants, i.e., bacteria or viruses and prevent the contaminants from entering other connection pipelines or cavities of a pulmonary function instrument.