Structures and magnetic properties of Fe n chains encapsulated in tubal carbon nanocages, C 10͑n+1͒ ͑n =1-4͒ and C 48 ͑n =1,2͒, are studied by means of the first-principles approach of noncollinear magnetism, in which the atomic and magnetic structures can be optimized simultaneously and self-consistently. The optimizations show that the globular capsule FeC 20 is energetically unfavorable, while the longer capsule Fe n C 10͑n+1͒ for n =2-4 becomes favorable and retains the linear structure of the iron chain along the center axis of the cages. The spin magnetic moments of the Fe atoms align in antiparallel for n = 2 and 4 in contrast with the parallel magnetic moments in bare Fe n chains. These antiferromagnetic configurations are stabilized by effective antiferromagnetic interactions induced by the carbon cages, where the small magnetic moments appear in the same orientation as those of the adjacent Fe atoms. For thicker capsules Fe n C 48 , Fe atoms also settle along the center axis of the cage. Due to the decrease of interaction between Fe and C atoms, the parallel alignment of magnetic moments on Fe atoms is more stabilized than the antiparallel one. For both the cages C 10͑n+1͒ and C 48 , terminal effects play a certain role in the settlement of Fe atoms along the center axis and the antiferromagnetic arrangement.