In order to improve the measuring accuracy of micro-electromechanical system (MEMS) resonant sensor with micro-cantilever structure to measure fluid density, a temperature compensation method is presented. The elastic modulus of the micro-cantilever is calculated considering its temperature coefficient so that the working equation to measure fluid density is obtained with decreasing temperature disturbance on the measuring accuracy. The simulations and experimental measurements of several fluids with different densities were carried out by the MEMS micro-cantilever resonant sensor under different temperatures. The simulation analyses showed that the fluid densities measured by using the proposed resonant density sensor with temperature compensation were more fitted with the reference density values than those without temperature compensation. The experimental results showed that both the measuring accuracy and stability of the MEMS micro-cantilever resonant sensor in fluid density measurement were increased more than twice based on the temperature compensation method. Therefore, the proposed temperature compensation method is important to improve the measuring precision and stability of the MEMS micro-cantilever resonant sensor in fluid density detection fields.