Abstract This paper reviews the state of the art of micro and nano-optoelectromechanical systems, which in the last years have changed in many ways our common view about optical and quantum electronic devices. Starting with their technological realization through the micromachining of semiconductors, the paper then presents the physical principles of micromechanical devices, their integration with optoelectronic devices, as well as the realization of free-space optical components with the help of semiconductor technology. The application of microoptomechanical systems in optical signal processing, optical data computing, and optical field characterization is further presented in detail revealing the new physical principles used to achieve these goals. The emerging area of the microoptomechanical systems applications for the signal detection in infrared up to the highest far-infrared limit, i.e. the terahertz region, is also analyzed here. The paper ends with a presentation of nanooptomechnical systems analyzing their inherent difficulties of realization as well as their advantages with a special emphasis on the optical properties of carbon nanotubes.