Rigidity of initial fixation is a key factor contributing to the longevity of cemented and cementless femoral components in total hip arthroplasty. The objective of this study was to measure the initial stability of primary cemented and cementless femoral components under load when 15 pairs of cadaveric femurs were prepared by outward compaction of femoral cancellous bone in situ or by conventional extraction broaching. Three-dimensional micromotion was measured at proximal and distal locations on the femoral components using a device with spherical targets and linear variable differential transformers. External loads simulating the stance phases of level walking and stair ascent were applied to the femoral components by a materials test machine. Bone preparation method significantly affected each of the translation and rotation components of micromotion with cemented and cementless fixation. Micromotion with broaching was consistently greater than with compaction. Compared with compaction, the magnitude of the micromotion translation vector for broaching was an average of 3.9 (standard deviation, 3.1) times greater with cemented fixation, and an average of 2.3 (standard deviation, 1.4) times greater with cementless fixation. The results of this study showed the effectiveness of compaction of femoral cancellous bone in improving the initial stability of cemented and cementless femoral components in primary total hip arthroplasty.