New energy vehicles (NEVs) have emerged as a promising solution to reduce carbon emissions and address environmental concerns in the transportation sector. In order to effectively accelerate market acceptance, it is crucial to prioritize the heterogeneity of consumer preferences for NEV attributes. This study employs the multinomial logit model (MNL) and latent class model (LCM) to investigate both observed and unobserved preference heterogeneity based on stated preferences obtained from a discrete choice experiment conducted across seven cities in China. Results from the MNL model indicate that all attributes significantly influence alternative utility. In particular, there are differences in the willingness to pay (WTP) for attributes of battery electric vehicles (BEVs) and plug-in hybrid electric vehicles (PHEVs). Analysis of MNL subgroups reveals observed heterogeneity in WTP for identical attributes among consumers from regions with different latitudes and markets with different NEV penetration rates. Furthermore, the LCM model uncovers unobserved preference heterogeneity by classifying respondents into four distinct classes and identifies specific socioeconomic variables associated with each class. The recognition of heterogeneous WTP for NEV attributes across vehicle types, regions, markets, and consumer classes provides important implications for formulating targeted policies that promote the sustainable development of the NEV industry.