We develop an analogue for sphere packing of the linear programming bounds for error-correcting codes, and use it to prove upper bounds for the density of sphere packings, which are the best bounds known at least for dimensions 4 through 36. We conjecture that our approach can be used to solve the sphere packing problem in dimensions 8 and 24. Contents 1. Introduction 2. Lattices, Fourier transforms, and Poisson summation 3. Principal theorems 4. Homogeneous spaces 5. Conditions for a sharp bound 6. Stationary points 7. Numerical results 8. Uniqueness Appendix A. .