The pitch angles of the local magnetic field in our Galaxy, previously derived from Rotation Measures (RMs) of pulsars by many authors, are not consistent with each other and with the pitch angles of the local spiral arms. That may be due to the fact that the used pulsar samples are located in different arms in which the directions of the magnetic fields are different. In this paper 2-D and 3-D models for the local magnetic field based on spiral arms are proposed for fitting the RMs of 129 nearby pulsars. In our models the amplitude of the uniform field changes sinusoidally to avoid abrupt reversals, and the directions are parallel or anti-parallel. The best-fitting 2-D model shows that in the Orion arm the strength of the regular field component is 2.4 ± 0.3μG, with its direction towards l = 73° ± 3°. There is a direction reversal in Sagittarius-Carina arm beginning at D rev = 0.3Kpc. The half “wavelength” of the sinusoidal variation is about 1.7 ± 0.4Kpc. The best fitting 3-D model shows that the scale height is only about 0.16 Kpc, which means that the local uniform field is confined in the galactic plane. The strongest regular field in this 3-D model is about 2.8±0.3μG. The results from both, the 2-D model as well as the 3-D model, show that the orientation of the field is in excellent agreement with the spiral arms.