Magnetic fields of cool stars can be directly investigated through the study of the Zeeman effect on photospheric spectral lines using several approaches. With spectroscopic measurement in unpolarised light, the total magnetic flux averaged over the stellar disc can be derived but very little information on the field geometry is available. Spectropolarimetry provides a complementary information on the large-scale magnetic topology. With Zeeman-Doppler Imaging (ZDI), this information can be retrieved to produce a map of the vector magnetic field at the surface of the star, and in particular to assess the relative importance of the poloidal and toroidal components as well as the degree of axisymmetry of the field distribution. The development of high-performance spectropolarimeters associated with multi-lines techniques and ZDI allows us to explore magnetic topologies throughout the Hertzsprung-Russel diagram, on stars spanning a wide range of mass, age and rotation period. These observations bring novel constraints on magnetic field generation by dynamo effect in cool stars. In particular, the study of solar twins brings new insight on the impact of rotation on the solar dynamo, whereas the detection of strong and stable dipolar magnetic fields on fully convective stars questions the precise role of the tachocline in this process.