We review hard X-ray microscopy techniques with a focus on scanning microscopy with synchrotron radiation. Its strength compared to other microscopies is the large penetration depth of hard x rays in matter that allows one to investigate the interior of an object without destructive sample preparation. In combination with tomography, local information from inside of a specimen can be obtained, even from inside special non-ambient sample environments. Different X-ray analytical techniques can be used to produce contrast, such as X-ray absorption, fluorescence, and diffraction, to yield chemical, elemental, and structural information about the sample, respectively. This makes X-ray microscopy attractive to many fields of science, ranging from physics and chemistry to materials, geo-, and environmental science, biomedicine, and nanotechnology. Our scanning microscope based on nanofocusing refractive X-ray lenses has a routine spatial resolution of about 100 nm and supports the contrast mechanisms mentioned above. In combination with coherent X-ray diffraction imaging, the spatial resolution can be improved to the 10 nm range. The current state-of-the-art of this technique is illustrated by several examples, and future prospects of the technique are given.