This paper presents a direct current-space-vector control of an active power filter (APF) based on a three-level neutral-point-clamped (NPC) voltage-source inverter. The proposed method indirectly generates the compensation current reference by using an equivalent conductance of the fundamental component using APF's dc-link voltage control. The proposed control can selectively choose harmonic current components by real-time fast Fourier transform to generate the compensation current. The compensation current is represented in a rotating coordinate system with chosen switching states from a switching table implemented in a field-programmable gate array. In addition, a three-phase four-wire APF based on a three-level neutral-point-clamped inverter is also presented. The proposed APF eliminates harmonics in all three phases as well as the neutral current. A three-phase three-wire NPC inverter system can be used as a three-phase four-wire system since the split dc capacitors provide a neutral connection. To regulate and balance the split dc-capacitor voltages, a new control method using a sign cubical hysteresis controller is proposed. The characteristics of the APF system with an LCL-ripple filter are investigated and compared with traditional current control strategies to evaluate the inherent advantages. The simulation and experimental results validated the feasibility of the proposed APF.