This paper introduces a complete real-time algorithm, where the chatter is detected and eliminated by spindle speed manipulation via the chatter energy feedback calculated from the axis encoder measurement. The proposed method does not require profound knowledge of the machining dynamics; instead, the entire algorithm exploits the fact that milling vibrations consist of forced vibrations at spindle speed harmonics and chatter vibrations that are close to one of the natural modes, with sidebands which are spread at the multiples of spindle speed frequency above and below the chatter frequency. The developed algorithm is able to identify the amplitude, phase and frequency of all the harmonics constituting the periodic forced and chatter vibrations. The key challenge is to select dominant chatter frequencies for the calculation of a robust and accurate chatter energy ratio feedback; this is achieved by utilizing the frequency estimation variance of EKF as a novel chatter indicator. Based on the chatter energy ratio feedback, the controller overrides the spindle speed in order to suppress the chatter energy below a particular threshold value. The varying spindle speed challenge is handled by updating the state transition matrices of the Kalman filters and real-time calculation of the band-pass filter coefficients, based on the derived discrete time transfer functions. The developed algorithm is tested on a Deckel FP5cc CNC which is in-house retrofitted and has a PC-based controller for the real-time application of the proposed algorithm. It is shown that the real-time chatter frequency and amplitude estimates are compatible with off-line FFT analysis, and chatter can be successfully eliminated by energy feedback.