Here we report on spectroscopic measurements of the aluminum monofluoride molecule (AlF) that are relevant to laser cooling and trapping experiments. We measure the detailed energy level structure of AlF in the X 1 Σ + electronic ground state, in the A 1 Π state, and in the metastable a 3 Π state. We determine the rotational, vibrational and electronic branching ratios from the A 1 Π state. We also study how the rotational levels split and shift in external electric and magnetic fields. We find that AlF is an excellent candidate for laser cooling on any Q-line of the A 1 Π -X 1 Σ + transition and for trapping at high densities.The energy levels in the X 1 Σ + , v = 0 state and within each Ω-manifold in the a 3 Π, v = 0 state are determined with a relative accuracy of a few kHz, using laser-radio-frequency multiple resonance and ionization detection schemes in a jet-cooled, pulsed molecular beam. To determine the hyperfine and Λ-doubling parameters we measure transitions throughout the 0.1 MHz -66 GHz range, between rotational levels in the X 1 Σ + , v = 0 state and between rotational and Λ-doublet levels in all three spin-orbit manifolds of the a 3 Π, v = 0 state. We measure the hyperfine splitting in the A 1 Π state using continuous wave (CW) laser-induced fluorescence spectroscopy of the A 1 Π, v = 0 ← X 1 Σ + , v = 0 band. The resolution is limited by the short radiative lifetime of the A 1 Π, v = 0 state, which we experimentally determine to be 1.90 ± 0.03 ns. The hyperfine mixing of the lowest rotational levels in the A 1 Π state causes a small loss from the the main laser cooling transition of 10 −5 . The off-diagonal vibrational branching from the A 1 Π, v = 0 state is measured to be (5.60 ± 0.02) × 10 −3 in good agreement with theoretical predictions. The strength of the spin-forbidden A 1 Π, v = 0 → a 3 Π, v = 0 transition is measured to be seven orders of magnitude lower than the strength of the A 1 Π, v = 0 → X 1 Σ + , v = 0 transition. We determine the electric dipole moments µ(X) = 1.515 ± 0.004 Debye, µ(a) = 1.780 ± 0.003 Debye and µ(A) = 1.45 ± 0.02 Debye in X 1 Σ + , v = 0, a 3 Π, v = 0 and A 1 Π, v = 0, respectively, by recording CW laser excitation spectra in electric fields up to 150 kV/cm.