Accurately estimating the magnitude within the initial seconds after the P‐wave arrival is of great significance in earthquake early warning (EEW). Over the past few decades, single‐parameter approaches such as the and methods have been applied to EEW magnitude estimation studies considering the first 3 s after the P‐wave onset. However, these methods present considerable scatter and are affected by the signal‐to‐noise ratio (SNR) and epicentral distance. In this study, using Japanese K‐NET strong‐motion data, we propose a machine‐learning method comprising multiple parameter inputs, namely, the support vector machine magnitude estimation (SVM‐M) model, to determine earthquake magnitudes and resolve the aforementioned problems. Our results using a single seismological station record show that the standard deviation of the magnitude prediction errors of the SVM‐M model is 0.297, which is less than those of the (1.637) and (0.425) methods. The magnitudes estimated by the SVM‐M model within 3 s after the P‐wave arrival are not obviously affected by the SNR or epicentral distance, and not overestimated for . In addition, in an offline EEW application, the magnitude estimation error of the SVM‐M model gradually decreases with increasing time after the first station is triggered, and the underestimation of event magnitudes for gradually improves. These results demonstrate that the proposed SVM‐M model can robustly estimate earthquake magnitudes and has potential for EEW.