Understanding urban consumers' preferences for rice attributes is crucial for rice breeders, producers, and retailers to meet diverse and evolving market demands. Based on the sample data of 629 rice consumers in Shanghai, China, obtained through the choice experiment (CE) approach, this study uses the mixed logit (ML) model to analyze consumers' preferences and willingness to pay (WTP) for food safety labels, brands, nutritional quality, and taste quality. Furthermore, the latent class (LC) model examines the heterogeneity in consumer group preferences. The research findings highlight that consumers prioritize taste quality as the most crucial attribute, followed by nutritional quality, food safety labels, and brand attributes. The premium rates for superior taste quality, organic certification labels, and green certification labels exceeded 100%. Interestingly, while combining organic certification with well-known international or domestic brands does not uniformly boost consumer preferences, incorporating green certification alongside well-known international or domestic brands significantly elevates those preference levels. Factors such as the external environment, consumption habits, and personal characteristics significantly influence individuals' preferences for rice attributes. Based on these insights, the study puts forth policy recommendations for rice breeders, producers, and retailers.