We found an exciting fluorescence enhancement phenomenon of ferulic acid (FA) and magnesium ions in strong alkaline medium. In KCl/NaOH buffer solution with pH = 12.30, Mg2+ ions could coordinate with FA to generate Mg-FA complex ions and also combined with hydroxide ions to form Mg(OH)2 nanosheets, and then the nanosheets further aggregated into Mg(OH)2-micro/nanoparticles (Mg(OH)2-MNPs). The Mg(OH)2-MNPs acted as potential matrix materials for surface-enhanced fluorescence (SEF). In this work, the fluorescence quantum yield and the fluorescence intensity of FA were significantly increased by about 50 times and hundreds of times by freshly formed Mg(OH)2-MNPs, respectively. Then, a highly sensitive method was developed for quantitative detection of FA. The fluorescence intensity at 440 nm under 370 nm light irradiation showed a good linearity with FA concentration in the range of 9.0 × 10−10 to 1.0 × 10–6 M (R2 = 0.9984), and the limit of detection (at S/N = 3) was 2.7 × 10−10 M. And then a convenient method for FA detection by smartphone assisted was also proposed. These methods were applied for detecting FA in real samples, and the recovery rates were range from 98.3 % to 103.1 %. This work provided an effective way for improving FA analytical sensitivity.