The design and fabrication techniques for microelectromechanical systems (MEMS) and nanodevices are progressing rapidly. However, due to material and process flow incompatibilities in the fabrication of sensors, actuators and electronic circuitry, a final packaging step is often necessary to integrate all components of a heterogeneous microsystem on a common substrate. Robotic pick-and-place, although accurate and reliable at larger scales, is a serial process that downscales unfavorably due to stiction problems, fragility and sheer number of components. Self-assembly, on the other hand, is parallel and can be used for device sizes ranging from millimeters to nanometers. In this review, the state-of-the-art in methods and applications for self-assembly is reviewed. Methods for assembling three-dimensional (3D) MEMS structures out of two-dimensional (2D) ones are described. The use of capillary forces for folding 2D plates into 3D structures, as well as assembling parts onto a common substrate or aggregating parts to each other into 2D or 3D structures, is discussed. Shape matching and guided assembly by magnetic forces and electric fields are also reviewed. Finally, colloidal self-assembly and DNA-based self-assembly, mainly used at the nanoscale, are surveyed, and aspects of theoretical modeling of stochastic assembly processes are discussed.