The conductivity tensors of single crystals and polycrystals of RFe2 (R = Gd,Tb,Ho,Lu) and GdCo2 were determined in the visible and near UV ranges. The magneto-optical Kerr effect (MOKE) was studied at different temperatures and magnetic fields. The single-crystal data show more features and larger magnitudes in the MOKE spectrum than the polycrystalline data under the same experimental conditions. The theoretical optical conductivity tensors for these compounds were calculated using the tight-binding linear-muffin-tin orbital (TB-LMTO) method in the local spin-density approximation. The agreement between theory and experiment was poor except for LuFe2, in which the 4f shell is completely closed.