We characterize local large-scale regular magnetic fields as well as small-scale magnetic features in the solar vicinity by using the rotation measures of 494 pulsars within 3 kpc from the Sun. The local magnetic field in the Galactic disc is found to follow local spiral arms and to have a field strength of 1.6 μG, with a reversal at 140 pc inside the solar circle in the direction of the Galactic Centre. A field reversal in the first quadrant towards the Sagittarius arm is identified at about 1 kpc from the Sun. In the local Galactic halo, the toroidal fields have a field strength of more than 1.6 μG. Local small-scale magnetic bubbles are investigated by using nearby pulsars in and behind these structures. The Local Bubble might have a line-of-sight magnetic field strength of 0.5-2 μG mainly towards l ∼ 90°; the upper shell of the Gum Nebula shows a possible amplification of the magnetic field with a factor of 2 probably by compression; the North Polar Spur does not contribute significant Faraday rotation, and perhaps its magnetic field is nearly perpendicular to the line of sight. An anomalous region in the fourth quadrant is found to have a field of 1.4 μG over a scale of 1 kpc, which implies a sub-Galactic structure with ordered fields opposite in direction to the large-scale disc field. We develop a model for the magnetic field in the Galactic halo based on the rotation measures of pulsars and averaged rotation measures of background radio sources.