Natural convection cooling of an electronic component in an electronic device using water-based Fe3O4 magnetic nanofluids is studied under the presence of the magnetic field. The heated vertical electronic component in an enclosure type electronic device with a magnetic field source is used as a model for the study. Different samples of Fe3O4-water nanofluid are prepared using different surfactants and the stability of those samples are estimated using visualization and zeta potential technique. Thermal properties of the stable sample of magnetic nanofluid are precisely measured. The experimentally measured properties are used for further theoretical study. The natural convection is characterized in terms of the relative position of the magnetic source and the electronic component, the strength of the magnetic field, and the magnetization of the nanofluids. Nine different combinations of the position of the magnetic source and the electronic component have been compared with the case in which there is an absence of the magnetic field. The dimensionless number used in this investigation are Rayleigh number (103 ≤ Ra ≤ 106), magnetic numbers (Mn = 100, 500, and 1000), and Hartmann Number (0 ≤ Ha ≤ 100). The position of the magnetic source with respect to the electronic component significantly affects the rate of heat transfer. The effect is more pronounced when the magnetic source is placed below any of the two vertical walls of the enclosure. The fluid flow is observed distorted near the magnetic source when the Ha is increased. The increment in the magnetic number strengthens the flow, which leads to the enhanced heat transfer rate.