Impulse noise can be classified as random valued impulse noise and fixed valued impulse noise. Fixed valued impulse noise is also called as the salt and pepper noise which is easy to remove as it only contains two kinds of noise models-0 and 255. For restoring the images contaminated by the random valued impulse noise which is much harder to remove, a new median filter based on the proportion of the variance is proposed in this paper. The algorithm contains two steps to restore the corrupted images. One is the identification of the random valued noisy pixels and the other one is the processing of the noisy points. This paper proposes an effective and easily implemented method based on the proportion of the variance to recognize the noise pixels and uses the standard median filter to remove them. To compare with some existing algorithms for removing the impulse noise in recent years, the algorithm proposed shows better performance.