We complete a classification of the groups of endotrivial modules for the modular group algebras of symmetric groups and alternating groups. We show that, for n ≥ p2, the torsion subgroup of the group of endotrivial modules for the symmetric groups is generated by the sign representation. The torsion subgroup is trivial for the alternating groups. The torsion-free part of the group is free abelian of rank 1 if n ≥ p2 + p and has rank 2 if p2 ≤ n < p2 + p. This completes the work begun earlier by Carlson, Mazza and Nakano.