Kohn−Sham density functional theory is a widely used electronic structure theory for molecules and systems in condensed phase. Given a set eigenfunctions of the Kohn-Sham Hamiltonian from an insulating system, it is often desirable to build a set of spatially localized basis functions for the associated subspace. We present a simple, robust, efficient, and parallelizable method to construct such a set of (optionally orthogonal) localized basis functions. The basis is constructed directly from a set of selected columns of the density matrix (SCDM) without the use of an optimization procedure. In addition, we demonstrate using the localized basis to efficiently perform Hartree−Fock exchange energy calculations and briefly discuss an extension of the SCDM procedure to solids with k-point sampling.