Sunspot number forecasting is a significant task for human beings in order to observe solar activity, and it is a classical chaotic time series. To improve the forecasting accuracy, we proposed a hybrid forecasting model based on empirical mode decomposition, long short‐term memory neural network and attention mechanism. First, the empirical mode decomposition is used to transfer the sunspot number to several sub‐components called IMFs and residual. Then, the IMFs and residual are input to the prediction module that is composed of long short‐term memory neural network and attention mechanism. Finally, the forecasting result is accumulated by the IMFs and residual through the predict module. The RMSE, MAE, MAPE and R2 indexes of our method are 1.567, 1.048, 1.8% and 0.9997. We also compare with GRU, informer and XGBoost‐DL, our method improves accuracy above 24 and 18 of RMSE and MAE, respectively. The experiment results demonstrate our method has higher precision. © 2023 Institute of Electrical Engineer of Japan and Wiley Periodicals LLC.