In this paper, we propose a smart charger for electric vehicles with a power-quality compensator. The proposed smart charger consists of four-leg insulated-gate bipolar transistors (IGBTs). Three legs are used for a single-phase full-bridge-based pulsewidth-modulated (PWM) rectifier, which converts power from ac to dc during the battery-charging operation or from dc to ac during the battery-discharging operation. This PWM rectifier can compensate reactive and unbalanced active currents on single-phase three-wire distribution systems because the third leg is connected to the neutral line of single-phase three-wire distribution feeders. The fourth leg is used as a bidirectional dc–dc converter for battery-charging and battery-discharging operations. The three-leg PWM rectifier uses only constant dc-capacitor voltage control, which is commonly used in active power line conditioners. Thus, the authors have developed the simplest possible control method for a single-phase power-quality compensator. The basic principle of the proposed smart charger is discussed in detail and then confirmed by digital computer simulation using PSIM software. A prototype experimental model is constructed and tested. Experimental results demonstrate that balanced source currents are obtained on the secondary side of the pole-mounted distribution transformer for battery-charging and battery-discharging operations.