Adding melamine as additives in food products will lead to many diseases and even death. However, the present techniques of melamine detection require time-consuming steps, complicated procedures and expensive analytical apparatus. The fluorescent assay method was facile and highly sensitive. In this work, a fluorescence resonance energy transfer (FRET) system for melamine detection was constructed based on conjugated polymer nanoparticles (CPNs) and gold nanoparticles (AuNPs). The energy transfer efficiency is up to 82.1%, and the system is highly selective and sensitive to melamine detection with a lower detection limit of 1.7 nmol/L. Moreover, the interaction mechanism was explored. The results showed that the fluorescence of CPNs were firstly quenched by AuNPs, and then restored after adding melamine because of reducing FRET between CPNs and AuNPs. Lastly, the proposed method was carried out for melamine detection in powdered infant formula with satisfactory results.