The method of magnetic field conditioning has a number of applications that include reduction of wax deposition in crude oil pipe lines, removal of inorganic scales in pipelines and increasing the fuel combustion efficiency. Although the method is being used commercially, the science behind it has not been understood very well. Hence it is necessary to do an elaborate investigation of the magnetic effect on hydrocarbons on microscopic as well as macroscopic level. The present study consists of finding the effect of magnetic field on the viscosity and ultraviolet (UV) spectra of individual hydrocarbons representing paraffins and aromatics. A regression based model is presented for predicting the effect of magnetic field on the viscosity of hydrocarbons. It is found that the viscosity of paraffins is the most affected with magnetic field under controlled conditions. UV spectra of the hydrocarbons undergo a change when subjected to magnetic field suggesting a change in the energy level of the electrons.