This article focuses on the design of a magnetic sensor (MS) in position detection of a permanent magnet linear motor (PMLM). The MS is composed of a hall-effect-integrated-circuit and magnetic materials, and it is well known as a contactless sensor with a simple structure, and low cost. As a result, it is preferred for precise linear positioning applications. The work presented in this article consists of the following three steps to achieve high accuracy and economy in the mover position detection for a PMLM. First, the initial design of the MS is described which has been optimized using response surface methodology to obtain very low total harmonic distortion value of the sensing signal. Second, the leakage flux of PMLM is analytically investigated, from which it is determined that shielding the leakage flux is most appropriate to ensure the accuracy of the MS. Finally, in an attempt to reduce manufacturing cost, three MS prototypes using different materials (silicon steel laminated core, steel solid core, and ferrite solid core) are fabricated and tested. To verify the analytical results, several experiments are conducted. The experimental data prove that the accuracy of the MS is sufficient to use for mover position detection for the PMLM.