Abstract The vehicle’s aerodynamic performance attracts increasing attention because it is critical to its power, fuel economy, and handling stability. Therefore, the aerodynamic analysis is one of the most essential components of car design. To develop new-generation energy-saving cars, this study investigates how the car shapes, especially the angle of the front and back windows, could affect a car’s aerodynamic performance. In particular, a computational fluid dynamics approach combined with a machine-learning algorithm is adopted to investigate the aforementioned problem and determine the optimal designs of a car. In this study, first, ANSYS Fluent is utilized to simulate the turbulent flows over 50 modeled two-dimensional cars with varying angles of front / back windows, followed by a case study on three-dimensional cars. The results show that the car shape could dramatically affect the aerodynamic performance of a car by changing the velocity and pressure fields near the wake region, leading to a reduction of the aerodynamic drag by up to 30%. Finally, using these simulation two-dimensional cars’ results as a training database, a machine learning-based algorithm is developed to predict the drag/lift coefficient quickly and thus find the optimal design.