In view of the shortcomings of the whale optimization algorithm (WOA), such as slow convergence speed, low accuracy, and easy to fall into local optimum, an improved whale optimization algorithm (IWOA) is proposed. First, the standard WOA is improved from the three aspects of initial population, convergence factor, and mutation operation. At the same time, Gaussian mutation is introduced. Then the nonfixed penalty function method is used to transform the constrained problem into an unconstrained problem. Finally, 13 benchmark problems were used to test the feasibility and effectiveness of the proposed method. Numerical results show that the proposed IWOA has obvious advantages such as stronger global search ability, better stability, faster convergence speed, and higher convergence accuracy; it can be used to effectively solve complex constrained optimization problems.