The calculation of f-f spectra of lanthanide and actinide ions by the multiconfiguration Dirac-Fock configuration interaction (MCDF-CI) method is discussed. The U 4+ , Pr 3+ , Np 3+ , Pm 3+ , Am 3+ and Eu 3+ ions are considered in detail. The effects of the different classes of excitation included and the flexibility of the basis of one-particle functions used on the calculated spectra are discussed. Breit and size-extensivity corrections are also considered. Reasonably accurate (errors <500 cm −1 ) spectra of U 4+ and Pr 3+ are achieved fairly readily and the best spectra of these ions are comparable with the most accurate published calculations. The best spectra of the other ions are less accurate but are in significantly better agreement with experiment than any previous ab initio calculation.