Recent years have seen tremendous progress in creating complex atomic many-body quantum systems. One approach is to use macroscopic, effectively thermodynamic ensembles of ultracold atoms to create quantum gases and strongly correlated states of matter, and to analyse the bulk properties of the ensemble. For example, bosonic and fermionic atoms in a Hubbard-regime optical lattice1, 2, 3, 4, 5 can be used for quantum simulations of solid-state models6. The opposite approach is to build up microscopic quantum systems atom-by-atom, with complete control over all degrees of freedom7, 8, 9. The atoms or ions act as qubits and allow the realization of quantum gates, with the goal of creating highly controllable quantum information systems. Until now, the macroscopic and microscopic strategies have been fairly disconnected. Here we present a quantum gas 'microscope' that bridges the two approaches, realizing a system in which atoms of a macroscopic ensemble are detected individually and a complete set of degrees of freedom for each of them is determined through preparation and measurement. By implementing a high-resolution optical imaging system, single atoms are detected with near-unity fidelity on individual sites of a Hubbard-regime optical lattice. The lattice itself is generated by projecting a holographic mask through the imaging system. It has an arbitrary geometry, chosen to support both strong tunnel coupling between lattice sites and strong on-site confinement. Our approach can be used to directly detect strongly correlated states of matter; in the context of condensed matter simulation, this corresponds to the detection of individual electrons in the simulated crystal. Also, the quantum gas microscope may enable addressing and read-out of large-scale quantum information systems based on ultracold atoms.