Multidimensional Fourier transform on an irregular grid is a useful tool for various seismic forward problems caused by complex media and wavefield distributions. Using a shape-function-based strategy, we have developed four different algorithms for 1D and 2D nonuniform Fourier transforms, such as two high-accuracy Fourier transforms (the linear shape-function-based Fourier transform [LSF-FT] and the quadratic shape-function-based Fourier transform [QSF-FT]) and two nonuniform fast Fourier transforms (NUFFTs) (the linear shape-function-based NUFFT [LSF-NUFFT] and the quadratic shape-function-based NUFFT [QSF-NUFFT]), respectively, based on their linear and quadratic shape functions. The main advantage of incorporating shape functions into the Fourier transform is that triangular elements can be used to mesh any complex wavefield distribution in the 2D case. Therefore, these algorithms can be used in conjunction with any irregular sampling strategies. The accuracy and efficiency of the four nonuniform Fourier transforms are investigated and compared by applying them in frequency-domain seismic wave modeling. All of the algorithms are compared with the exact solutions. Numerical tests indicate that the quadratic shape-function-based algorithms are more accurate than those based on the linear shape function. Moreover, LSF-FT/QSF-FT exhibits higher accuracy but much slower calculation speed, whereas LSF-NUFFT/QSF-NUFFT is highly efficient but has lower accuracy at near-source points. In contrast, a combination of these algorithms, by using QSF-FT at near-source points and LSF-NUFFT/QSF-NUFFT at others, achieves satisfactory efficiency and high accuracy at all points. Although our tests are restricted to seismic models, these improved NUFFT algorithms may also have potential applications in other geophysical problems, such as forward modeling in complex gravity and magnetic models.