According to the principle of IEC flicker meter, an algorithm for flicker calculation based on spectrum analysis isproposed. First, FFT is used to calculate the parameters of each frequency component. Then, voltage flicker is obtained byusing these parameters. The algorithm can calculate not only the total instantaneous flicker sensation level caused by themodulated wave and interharmonics, but also the percentage of the instantaneous flicker sensation level due to eachinterharmonic or each pair of interharmonics, namely, the contribution of each interharmonic or each pair of interharmonics tothe total instantaneous flicker sensation level. The algorithm demonstrates that the modulated wave is a special case ofinterharmonics. When the input voltage contains a pair of interharmonics, the instantaneous flicker sensation level due to theinteraction of each pair of interharmonics is related to the initial phase angles of the fundamental wave and interharmonics,which are not considered or considered as zero in previous study. A comparison of the result using the new algorithm with thatof IEC algorithm demonstrates the effectiveness and accuracy of the former.