The structures and magnetic and electronic attributes of the Fen + 1@C32 and FenN@C32 (n = 1–3) clusters have been investigated by the PBE function. The results indicate that the Fe atoms prefer to occupy the center of a hexagonal C ring while the N atoms prefer to occupy the C–C bridge site. There is not enough space inside the C32 cages to embed larger Fen + 1 or FenN clusters by the binding energies. The FenN@C32 clusters are more structurally stable than the corresponding Fen + 1@C32 clusters by the embedding energies. The Fe@C32, Fe4@C32, N@C32 and Fe3N@C32 clusters are more kinetically stable than their neighbors by the HOMO-LUMO gaps. The spin polarization of the Fen + 1@C32 and FenN@C32 clusters is completely degraded to zero by the C32 coating. The N atoms for the FenN@C32 clusters accept electrons from the Fe and C atoms.