In mathematics, **Spanier–Whitehead duality** is a duality theory in homotopy theory, based on a geometrical idea that a topological space *X* may be considered as dual to its complement in the *n*-sphere, where *n* is large enough. Its origins lie in the Alexander duality theory, in homology theory, concerning complements in manifolds. The theory is also referred to as **S-duality**, but this can now cause possible confusion with the S-duality of string theory. It is named for Edwin Spanier and J. H. C. Whitehead, who developed it in papers from 1955.

The basic point is that sphere complements determine the homology, but not the homotopy type, in general. What is determined, however, is the stable homotopy type, which was conceived as a first approximation to homotopy type. Thus Spanier–Whitehead duality fits into stable homotopy theory.

Let *X* be a compact neighborhood retract in
R
n
. Then *X*^{+} and
Σ
−
n
Σ
′
(
R
n
∖
X
)
are dual objects in the category of pointed spectra with the smash product as a monoidal structure. Here *X*^{+} is the union of *X* and a point,
Σ
and
Σ
′
are reduced and unreduced suspensions respectively.

Taking homology and cohomology with respect to an Eilenberg-MacLane spectrum recovers Alexander duality formally.