The purpose of this study is to investigate the behavior of magnetic powders during compaction in an applied magnetic field, which is a common manufacturing process for producing permanent magnets. We employ a nonspherical axi-symmetric particle model and carry out simulation of compaction in a magnetic field to study the alignment of the easy axes. Compacting and lateral pressures appear to change by the application of magnetic field. The results of compacting pressures show qualitative agreement with experimental ones, and the alignment of the easy axes is significantly influenced by the application of magnetic field. It is shown that alignment of the easy axes obtained by the simulation is supported by experimental observations.