Source optimization is one of the key techniques for achieving higher resolution without increasing the complexity of mask design. An efficient source optimization approach is proposed on the basis of particle swarm optimization. The pixelated sources are encoded into particles, which are evaluated by using the pattern error as the fitness function. Afterward, the optimization is implemented by updating the velocities and positions of these particles. This approach is demonstrated using three mask patterns, including a periodic array of contact holes, a vertical line/space design, and a complicated pattern. The pattern errors are reduced by 69.6%, 51.5%, and 40.3%, respectively. Compared with the source optimization approach via genetic algorithm, the proposed approach leads to faster convergence while improving the image quality at the same time. Compared with the source optimization approach via gradient descent method, the proposed approach does not need the calculation of gradients, and it has a strong adaptation to various lithographic models, fitness functions, and resist models. The robustness of the proposed approach to initial sources is also verified.