An optical fiber formaldehyde biosensor based on a modified single sol–gel film consisting of alcohol oxidase (AOX) and chlorophenol red (CPR) was developed. The modification relies on addition of poly(vinyl alcohol) (PVA) into sol–gel matrix, in order to increase the function of AOX. The biosensing element on a sol–gel film has been placed inside the flow-cell for the flow system measurements. In the presence of a constant AOX, a color change of the CPR was measured in term of its reflected signal intensity at the wavelength 555 nm. This color change could be related to the formaldehyde concentration in the sample solutions. The performance of optical formaldehyde biosensor in the flow system has been optimized. The formaldehyde biosensor exhibited a dynamic linear response range in the formaldehyde concentration range of 0–10 mg/L with linear correlation (r ) was 0.996. The detection limit of the biosensor was 0.035 mg/L while reproducibility was < 1% RSD (relative standard deviation). Tofu as real food sample were analysis using the biosensor revealed that it was promising for food analysis of formaldehyde.