The numerical simulation of the development of a streamer discharge in a gap with an external longitudinal magnetic field was used to demonstrate the self-focusing of such discharges. Selffocusing is caused by a sharp deceleration of the radial ionization wave due to a change in the electron energy distribution function, a decrease in the average electron energy, the rate of gas ionization and the electron mobility in crossed electric and magnetic fields as compared to the case of the discharge development without a magnetic field. The self-focusing effect of a streamer discharge in an external longitudinal magnetic field is observed for both positive and negative pulse polarities. The paper proposes an estimate of the critical value of the magnetic field, which makes it possible to control the development of pulsed high-voltage discharges at various gas pressures.