In this work, we aimed to find a general method suitable for coping in real time with stochastic error which is a main feature of most of low cost Micro Electro Mechanical Systems(MEMS) gyroscope. First of all, Allan variance was utilized to analyze the drift error of MEMS gyroscope. According to its characteristic, we designed a real time average estimate algorithm to eliminate gross error. Then, the least square algorithm was applied to extrapolate the predicted value of next step through the previous output values. Based on the aforementioned works, we finally worked out a Kalman filter which efficiently reduces angle random walk and variance of output. This method can be applied to most of low cost MEMS gyros cope because the least square algorithm avoided the problem of being difficult to accurately model drift error. Testing results demonstrate that this method is available both in static and angular rate variation situations. After filtering, quite a bit of improvement is obtained, part of constant drift rate was compensated; raw measurement variance is reduced by more than 99 percent; random walk also has been effectively removed from random drift error.