This publication provides an overview of magnetic fields in the solar atmosphere with the focus lying on the corona. The solar magnetic field couples the solar interior with the visible surface of the Sun and with its atmosphere. It is also responsible for all solar activity in its numerous manifestations. Thus, dynamic phenomena such as coronal mass ejections and flares are magnetically driven. In addition, the field also plays a crucial role in heating the solar chromosphere and corona as well as in accelerating the solar wind. Our main emphasis is the magnetic field in the upper solar atmosphere so that photospheric and chromospheric magnetic structures are mainly discussed where relevant for higher solar layers. Also, the discussion of the solar atmosphere and activity is limited to those topics of direct relevance to the magnetic field. After giving a brief overview about the solar magnetic field in general and its global structure, we discuss in more detail the magnetic field in active regions, the quiet Sun and coronal holes.