Necessary conditions for a soliton on a torus M = R m /Λ to be a soliton crystal, that is, a spatially periodic array of topological solitons in stable equilibrium, are derived. The stress tensor of the soliton must be L 2 orthogonal to E, the space of parallel symmetric bilinear forms on T M , and, further, a certain symmetric bilinear form on E, called the hessian, must be positive. It is shown that, for baby Skyrme models, the first condition actually implies the second. It is also shown that, for any choice of period lattice Λ, there is a baby Skyrme model which supports a soliton crystal of periodicity Λ. For the three-dimensional Skyrme model, it is shown that any soliton solution on a cubic lattice which satisfies a virial constraint and is equivariant with respect to (a subgroup of) the lattice symmetries automatically satisfies both tests. This verifies in particular that the celebrated Skyrme crystal of Castillejo et al., and Kugler and Shtrikman, passes both tests.