This paper deals with three characteristics of the interplanetary magnetic field (IMF), important for solar wind–magnetosphere coupling and related to solar rotation: the IMF azimuthal component, the IMF total magnitude, and the handedness or the sense of rotation of magnetic clouds. The IMF configuration is described by Parker's Archimedian spiral model (Astrophys. J. 128 (1958) 664) under the assumptions of a purely radial solar wind with a constant velocity emanating from a uniformly rotating Sun. In situ measurements confirmed this general picture, but a systematic deviation from the predicted IMF winding angle was found, supposedly exhibiting a 11-year periodicity. We account for the non-uniform solar rotation and compare the observed IMF azimuthal component to the one calculated from Parker's formula with the measured equatorial solar rotation rate. We find that the differences between the calculated and measured IMF azimuthal component and the winding angle have a clear 22-year dependence on the solar polarity cycle, matching the 22-year periodicity in solar rotation rate rather than on the 11-year sunspot cycle. Our results are an observational confirmation of the validity of the model of Fisk (J. Geophys. Res. 101 (1996) 15547) for heliospheric magnetic field with footpoint motions due to solar differential rotation. Solar differential rotation is also an important element of the solar dynamo which is responsible for the generation of the solar magnetic field. We compare the different periodicities in the variations in the latitudinal rotation gradient of the two solar hemispheres and show that the IMF which is an extension of the solar coronal field, is related to the differential rotation in the more active solar hemisphere. Another feature related to solar differential rotation that is persistently different in the two solar hemispheres is the prevailing magnetic helicity, which is carried to the Earth by magnetic clouds preserving the helicity of the source region of their origin. The reaction of the magnetosphere to magnetic clouds is determined mainly by the presence or absence of a prolonged period of southward IMF component. We show that it also depends on the helicity of the clouds, and compare the effects of right- and left-handed magnetic clouds on geomagnetic activity.