We introduce spectral coarse spaces for the balanced domain decomposition and the finite element tearing and interconnecting methods. These coarse spaces are specifically designed for the two-level methods to be scalable and robust with respect to the coefficients in the equation and the choice of the decomposition. We achieve this by solving generalized eigenvalue problems on the interfaces between subdomains to identify the modes that slow down convergence. Theoretical bounds for the condition numbers of the preconditioned operators, which depend only on a chosen threshold, and the maximal number of neighbors of a subdomain are presented and proved. For the finite element tearing and interconnecting method, there are two versions of the two-level method: one based on the full Dirichlet preconditioner and the other on the, cheaper, lumped preconditioner. Some numerical tests confirm these results. Copyright © 2013 John Wiley & Sons, Ltd.