Most analysis of Cosmic Microwave Background spherical harmonic coefficients a ℓm has focused on estimating the power spectrum C ℓ = |a ℓm | 2 rather than the coefficients themselves. We present a minimum-variance method for measuring a ℓm given anisotropic noise, incomplete sky coverage and foreground contamination, and apply it to the WMAP data. Our method is shown to constitute lossless data compression in the sense that the widely used quadratic estimators of the power spectrum C ℓ can be computed directly from our a ℓm -estimators. As the Galactic cut is increased, the error bars ∆a ℓm on low multipoles go from being dominated by foregrounds to being dominated by leakage from other multipoles, with the intervening minimum defining the optimal cut. Applying our method to the WMAP quadrupole and octopole as an illustration, we investigate the robustness of the previously reported "axis of evil" alignment to Galactic cut and foreground contamination.