This study presents a real-time optimal torque control scheme for interior permanent magnet synchronous motors (IPMSMs). The proposed scheme enables computation of optimal current reference for a torque reference under all operating regions, including the maximum torque per ampere (MTPA), flux weakening (FW), maximum current (MC), and maximum torque per voltage (MTPV), using numerical optimization techniques to simplify the problems and obtain the corresponding solutions with reduced computation burden. Linearizing the torque equation of IPMSM is utilized to derive solutions for the MTPA and FW. These solutions are proved to converge to their optimum with the aid of the reference smoother. Numerical solutions for the MC and MTPV are derived based on the assumption that the resistive voltage drop is small enough but not zero. These solutions differ from the existing solutions that ignore the resistive voltage drop. The effectiveness of the proposed method is numerically and experimentally verified using a 7.5-kW IPMSM with a considerable reduction in computational time of approximately 90% in the simulation compared with the analytic solution.