Ferrario, Lilia2023-03-092023-03-091335-1842http://hdl.handle.net/1885/286949In this review I will summarise what we know about magnetic fields in stars and what the origin of these magnetic fields may be. I will address the issue of whether the magnetic flux is conserved from pre-main sequence to the compact star phase (fossil field origin) or whether fields may be dynamo generated during some stages of stellar evolution or perhaps during stellar merging events.L.F. acknowledges support from the Grant Agency of the Czech Republic (15-15943S)application/pdfen-AU© 2018 Slovak Academy of Scienceshttps://creativecommons.org/licenses/by/4.0/stars: magnetic fieldstars: protostarsstars: chemically peculiarwhite dwarfspulsarsstars: magnetarsStars with a Stable Magnetic Field20182021-12-26Creative Commons Attribution License