An exhaustive classification scheme of topological insulators and superconductors is presented. The key property of topological insulators (superconductors) is the appearance of gapless degrees of freedom at the interface/boundary between a topologically trivial and a topologically non-trivial state. Our approach consists in reducing the problem of classifying topological insulators (superconductors) in d spatial dimensions to the problem of Anderson localization at a (d − 1) dimensional boundary of the system. We find that in each spatial dimension there are precisely five distinct classes of topological insulators (superconductors). The different topological sectors within a given topological insulator (superconductor) can be labeled by an integer winding number or a Z2 quantity. One of the five topological insulators is the “quantum spin Hall” (or: Z2 topological) insulator in d = 2, and its generalization in d = 3 dimensions. For each dimension d, the five topological insulators correspond to a certain subset of five of the ten generic symmetry classes of Hamiltonians introduced more than a decade ago by Altland and Zirnbauer in the context of disordered systems (which generalizes the three well known “Wigner-Dyson” symmetry classes).