This paper describes a method of model reduction by using Karhunen-Loève decomposition and Galerkin procedure to effectively perform the dynamic simulation and analysis of nonlinear microelectromechanical systems and devices. The Karhunen-Loève decomposition is a procedure for extracting a basis for a modal decomposition from an ensemble of signals, e.g. numerical or experimental data, thus converts the original systems into a lumped low-order macromodel with minimum number of degree of freedom. The macromodel can be used to carry out the dynamic simulation of the original systems resulting in dramatic reduction of computation time while not losing flexibility and accuracy. The method is evaluated to simulate the pull-in dynamics of a microrelay MEMS device, e.g. doubly clamped microbeam, subjected to different input voltage spectrum of electrostatic actuation. The results are compared with those of the fully meshed finite difference method (FDM) and found to be very accurate, efficient and flexible.