Vitamin B2 (VB2) is an essential nutrient for the human body and plays important roles in human health. Therefore, the construction of an efficient sensor for VB2 detection is required. Here, a fluorescent Zn(II)-MOF of 1,2-bis(benzimidazol-1-ylmethyl)benzene (1,2-bbix), {[Zn(1,2-bbix)(OH)](NO3)·0.5H2O}2n (MOF 1), was prepared for the ratiometric detection of VB2. MOF 1 displays an interesting 2-fold interpenetrated dia network based on tetranuclear Zn4 clusters. MOF 1 emitted blue fluorescence at 409 nm, which was quenched after adding VB2, while a new and enhanced emission at 537 nm associated with VB2 was clearly observed, thereby establishing an effective ratiometric fluorescence method for VB2 detection. MOF 1 can selectively detect VB2 in aqueous media with the limit of detection being 0.11 μM. MOF 1 can also detect VB2 in real food and pharmaceutical samples (milk and VB2 tablets) with recoveries of 93.5-103.8%. The ratiometric sensing mechanism was investigated via powder X-ray diffraction (PXRD), IR, ultraviolet-visible (UV-vis), fluorescence lifetimes, X-ray photoelectron spectroscopy (XPS), and theoretical calculations. Additionally, a simple smartphone-assisted RGB method was developed for the visual detection of VB2. The present work provides an effective on-off ratiometric fluorescence sensor for VB2 detection, which has great potential application in the food and pharmaceutical fields.