In order to investigate the biomass pyrolysis mechanism of rapeseed under magnetic field for their conversion to bio-oil, a technical study was carried out for reducing the bio-oil viscosity to enhance its quality. Rapeseed were used as the raw material, and pyrolysis experiments were conducted at the final temperature of 500 ℃ under four different conditions: no magnetic field, three normal magnetic fields with different magnetic induction intensities (3000 GS, 6000 GS, and 9000 Gs), and a Halbach array magnetic field with 6000 GS. An analysis was conducted on the yield of pyrolysis products, as well as the physicochemical properties and composition of bio-oil. The results indicated that, compared to pyrolysis in the absence of magnetic field, the pyrolysis under magnetic field accelerated the heating process of rapeseeds and affected the pyrolysis reaction. Compared to the pyrolysis without magnetic field, the yield of pyrolysis gas increased from 19.09% to 20.23%, 20.83%, and 21.41% for the magnetic induction intensities of 3000, 6000 and 9000 Gs, respectively. Additionally, with the change in the magnetic induction intensities through values of 3000, 6000 and 9000 Gs, the viscosity of bio-oil decreased from 17.21 mPa·s to 13.99 mPa·s, 11.45 mPa·s, and 10.09 mPa·s, respectively. This suggests that the magnetic field significantly reduced the viscosity of bio-oil derived from rapeseeds, and slightly promoted the conversion of pyrolysis products into pyrolysis gas. When the volume of the magnet decreased by 53.69%, the proportion of pyrolysis bio-oil increased by 8.99%, while the viscosity of the oil decreased by 23.47%, indicating a significant optimization effect. Physicochemical analysis reveals that the moisture content of the pyrolysis oil as well as the hydrophilic groups in the oil obtained under magnetic field conditions increased, which is the main reason for the reduction in the viscosity of the oil. Combined with the in-depth mechanism analysis of magnetic field pyrolysis using simulations in the software package COMSOL, it is concluded that magnetic field pyrolysis enhances heat transfer through magnetoconvection and alters the pyrolysis reaction pathway by affecting the combinations of free radicals.