The multilevel fast multipole algorithm (MLFMA) using K-means clustering to accelerate electromagnetic scattering analysis for large complex targets is presented. By replacing the regular cube grouping with the K-means clustering, the addition theorem is more accurately approximated. The convergence rate of an iterative solver is thus improved significantly. However, irregular centroid locations as a result of the K-means clustering increase the amount of explicit transfer function calculations, compared with the regular cubes. In the MLFMA, a multilevel hierarchical structure is applied to the finite multipole method (FMM) to reduce transfer function calculations. Therefore, the MLFMA is suitable for applying K-means clustering. Simulation results with both canonical and realistic targets show an improvement in the computation time of the proposed algorithm.