In this paper, a novel retrofit LED(Lighting-emitting diode) is proposed to replace the T8/40W fluorescent lamp. The proposed retrofit LED lamp contains a frequency sensing circuits, driving circuit and LED module, which is suitable for AC grid, electromagnetic ballast, and electronic ballast applications. The advantages of the proposed retrofit LED lamp are small size and easy to design. The frequency sensing circuits is constructed of a low-pass filter, peak detector circuit, and voltage comparator to clarify the input voltage frequency of the retrofit LED lamp. The operational principles of the proposed retrofit LED is analyzed and the key parameters of the proposed retrofit LED are designed. Then, the simulation software is used to verify the feasibility of the proposed retrofit LED lamp. Finally, a 22W retrofit LED prototype is built in the laboratory for both ballasts and universal AC grid voltage applications.