In the present paper, a numerical study is conducted to examine the effect of a nonuniform magnetic field on the melting process of phase change material (PCM) in a finned triple tube. Lauric acid is considered as the PCM. The effect of fin length, the radius of the middle tube, porous fin, nanoparticles, and nonuniform magnetic field on PCM melting performance has been explored. The enthalpy-porosity method is employed for simulating the melting process. The results show that the melting rate in a finned triple tube is higher than in a finned double tube. The melting rate of PCM decreases by increasing the radius of the middle tube and decreasing the length of the fins on this tube. The use of nanoparticles improves the melting performance. When using a porous fin, increasing the Darcy number and porosity coefficient has a negative effect on melting performance and reduces the liquid fraction. Utilizing a nonuniform magnetic field improves the melting performance. The liquid fraction is increased significantly as the intensity of the magnetic field is increased. Compared to the base case, the liquid fraction is increased by 19.29%, 81.57%, 3.26%, and 89.12%, respectively, utilizing nanoparticles, nonuniform magnetic field, porous fin, and nonuniform magnetic field/nanoparticle.