Abstract Based on vector diffraction theory, a phase-only filter with cosine function is proposed and a sharper focal spot of radially polarized beam is obtained on the focal plane. The function parameters of the filter are optimized and a series of optimized filters for different Strehl ratio S are given. The optimization results show that there is a significant improvement on obtaining sharper focal spot with this new type of filter. Compared with other results, this type of filters has superior supperresolution effect and higher energy utilization ratio. The numerical calculation results about the phase filter may facilitate new approaches to get superresolution.