Fast Fourier Transform (FFT) is widely used for the signal processing because of its computational efficiency. Most power quality meters and digital relays adopt FFT-based algorithm to characterize harmonics of the measured signals. A typical FFT-based algorithm may lead to inaccurate results, if the system frequency varies. This paper proposes an improved FFT-based algorithm for measuring harmonics. The performance of the proposed algorithm is then validated by testing the simulated and actual measured signals. Results are compared with those obtained by the conventional FFT algorithm and by a power quality meter. It shows that the proposed algorithm is computational efficient and the solution accuracy is maintained.