In order to improve its precision in dynamic environment, a Kalman filter was designed. Firstly, two sets of random drift data of MEMS gyro were respectively analysed, and it was found that the variance of random drift under random vibration significantly increased and its mean also changed. Then calculation results show that attitude angle error under random vibration is 2.6°, while in the static test it is 0.25°. Analysis on the characteristics of random drift was carried out, and it is found that it can be treated as stable, normally distributed random signal. Finally, a corresponding Kalman filter was designed. The results indicated that after filtering the variance of random drift is reduced to 0.0282, 26.4% of pre-filtering and the attitude angle error is reduced to 1.5°, 57.7% of pre-filtering. The above method can effectively compensate for the attitude angle error of MEMS gyro caused by random vibration. This study can be a reference to the application of low-cost MEMS gyro in aircraft navigation.