Each shell can contain only a fixed number of electrons: the first shell can hold up to two electrons, the second shell can hold up to eight (2 + 6) electrons, the third shell can hold up to 18 (2 + 6 + 10) and so on. The general formula is that the n th shell can in principle hold up to 2(n) electrons. For an explanation of why electrons exist in these shells, see electron configuration.