We have designed and demonstrated a prototype on-beam spin-exchange optical pumping (SEOP) 3He neutron spin filter (NSF). It is designed as the incident neutron polarizer for spallation neutron sources, where the installation space is limited due to thick radiation shielding. The size of the NSF is roughly 50 cm×50 cm×25 cm including the diode-laser optics with a frequency narrowing external cavity, and a cylindrical 3He cell as large as a diameter of 5 cm and a length of 10 cm can fit. A neutron beam test was performed at the NOP beamline of JRR-3 to see the performance of the NSF.