The aim of the study is the analysis of a uniform magnetic field effect on fluid flow, heat transfer, and entropy generation through the operation of a pulsating heat pipe (PHP). An open loop PHP with three neighboring vapor plugs and two liquid slugs has been considered. The governing equations such as momentum, energy, and mass equations are solved using an explicit method except for the energy equation of liquid slugs. For each case study, Bejan number has been derived to find the heat transfer share in entropy generation. According to the results, the performance of the oscillating heat pipe decreases by applying uniform magnetic field. Moreover, the obtained results illustrate the effects of the applied magnetic field position on the heat transfer and the entropy generation. The latent and sensible heat transfer into the PHP enhance as a result of increase in the pipe diameter, so that the liquid slugs oscillate with high amplitudes. In addition, the entropy generation value increases with an augmentation in the value of the pipe diameter. The evaluated Bejan numbers indicate that the viscous effects in entropy generation decrease as the pipe diameter increases. Furthermore, the results depict that the heat transfer performance of PHP improves by increasing temperature difference between evaporator and condenser sections. With an increase in the value of the evaporator temperature, the Bejan number will increase, as a result, this phenomenon reveals the inconsiderable role of viscous impacts in high evaporator temperatures. In order to validate the calculations, the calculated results have been compared with the previous studies which show good agreement.