An LED driver compatible with various electronic ballasts that are currently commercially used is newly proposed, which adopts a variable switched capacitor by controlling the switching duty cycle for LED power regulation. The resonant frequency of an LC resonant tank of electronic ballasts can be changed, which makes the proposed LED driver versatile for electronic ballasts for various switching frequencies. In this way, the fluorescent lamp is replaced with an LED lamp, where the electronic ballast in the lighting infrastructure remains unchanged. The zero voltage switching is applied for the variable switched capacitor in the electronic ballast, operating at a frequency of 30-60 kHz. Neither an inductor nor a transformer is introduced in the proposed LED driver, which leads to compact size and high efficiency. Furthermore, no electrolytic capacitor is used, which is beneficial for the long lifetime of LED drivers. A prototype LED driver of 16 W was implemented and verified for the three types of electronic ballasts that are most popular in markets. The LED power was well regulated for a wide range of the source voltage variations between 180 and 270 V, and the power efficiencies of the proposed LED driver were 95.8%, 96.1%, and 94.1% for the instant start, rapid start, and programmed start types of the electronic ballasts, respectively.