Design of end magnetic structures for a hybrid undulator is very complicated. In this article, magnetic field calculation was carried out using the "Radia" code, aimed to optimize the end magnetic structures for the Shanghai DUV-FEL hybrid undulator with a fixed gap. Without electromagnet correction, the first and second field integrals of the hybrid undulator were almost zero by reducing sizes of the two final magnets and positioning the two end poles. After the shield was added outside the final magnet, the fringe fields were lower than 5×10‑4 T off 10 mm to the final magnet.