Beamforming can steer the mainlobe of the beam pattern towards the desired signal and set several nulls in the directions of interference signals by adjusting the excitation weights of array elements. These days, a range of meta-heuristic algorithms have been utilized for the beamforming of antenna arrays. However, most of the methods are applied to linear arrays and rarely to planar arrays. In this paper, a novel variant of binary particle swarm optimization (BPSO) is proposed at first, where the global search ability and local optimization ability are both taken into account. Then, the fitness function including the term of peak sidelobe level (PSLL) is constructed, and the improved BPSO is applied to the beamforming of uniform planar array (UPA). Finally, simulation results demonstrate that by setting the parameters reasonably, the proposed algorithm is not only able to suppress PSLL effectively, but also able to form deeper nulls than that of linearly constrained minimum variance (LCMV).