Subwavelength resolution imaging requires high numerical aperture (NA) lenses, which are bulky and expensive. Metasurfaces allow the miniaturization of conventional refractive optics into planar structures. We show that high-aspect-ratio titanium dioxide metasurfaces can be fabricated and designed as metalenses with NA = 0.8. Diffraction-limited focusing is demonstrated at wavelengths of 405, 532, and 660 nm with corresponding efficiencies of 86, 73, and 66%. The metalenses can resolve nanoscale features separated by subwavelength distances and provide magnification as high as 170×, with image qualities comparable to a state-of-the-art commercial objective. Our results firmly establish that metalenses can have widespread applications in laser-based microscopy, imaging, and spectroscopy.