Accurate forecasting is the key factor in promoting wind power consumption and improving the stable operation of power systems. A short-term wind power forecasting (WPF) and uncertainty analysis method based on whale optimization algorithm (WOA), least squares support vector machine (LSSVM), and nonparametric kernel density estimation (NPKDE) was proposed in this paper. The advantages of WOA (fast convergence speed and high convergence accuracy) were used to optimize the penalty factor and kernel function width of the LSSVM model, and the calculation speed and forecasting accuracy of the LSSVM model were improved. The training sample set is classified according to the wind speed interval, and the WOA-LSSVM forecasting model is trained by subclass after classification to further improve the accuracy of short-term WPF. The NPKDE method is used to accurately calculate the probability density distribution characteristics of the forecasting error of wind power, and the confidence interval of the WPF is accurately calculated based on the probability density distribution characteristics. The calculation results show that the forecasting accuracy of the WOA-LSSVM model is higher than those of the LSSVM, long short-term memory (LSTM), and particle swarm optimization and least squares support vector machine (PSO-LSSVM) models, and the forecasting accuracy of the WOA-LSSVM model can be further improved after classifying the training sample set. The coverage of the confidence intervals in different time scales is higher than the corresponding confidence level, indicating that the NPKDE method can accurately describe the probability density distribution characteristics of the WPF errors.