The second-hand car market is a hot topic. Buying a second-hand car has advantages in price and many other aspects. Therefore, it is important to establish a good price prediction model. This paper will explore the factors that affect the price of second-hand cars. After analyzing and learning many kinds of literature, this paper establishes a multiple linear regression model and a random forest model and makes a comparative analysis of the model effect. The sum of the square error and R-square value of the random forest are better than the multiple linear regression model. Among the factors affecting the price of second-hand cars, the year of production has the greatest impact on the price, which shows that the age of the year is an important factor in determining the price of second-hand cars. The next most important factor is the number of kilometers traveled, followed by fuel type and transmission type-finally, engine displacement, number of transfers and number of seats. The random forest model established in this paper has better application value to price prediction.