In order to elaborate the magneto-optical modulation process in detail and clarify the distribution of the magnetic field in the solenoid. In this paper, the magnetic field model of the solenoid with sine wave is established by Maxwell’s equation. The boundary condition is determined by the law of Ampere loop and the law of electromagnetic induction. The exact function expression of the magnetic field is obtained and the relevant factors are analyzed in detail. The simulation results show that the magnetic field in the solenoid with sine wave has good sine characteristic and the magnetic field is closely related to the factors such as the frequency of the driving signal and the axial magnetic field at any point inside the solenoid is much larger than the circumference magnetic field at that point. So, when the magnetic field at a point inside the solenoid is analyzed, it is possible to ignore the circumferential magnetic field at that point. But outside the solenoid, both directions of magnetic field need to be considered. In this paper, the method of studying the magnetic field of the solenoid provides a reference for the detailed analysis of the magnetic field inside and outside the solenoid under different signal driving.