The rapid urbanization trend underscores the need for effective management of city resources and services, making the concept of smart cities increasingly important. This study leverages the IMD Smart City Index (SCI) dataset to analyze and rank smart cities worldwide. Our research has a dual objective: first, we aim to apply a set of unsupervised learning models to cluster cities based on their smartness indices. Second, we aim to employ supervised learning models such as random forest, support vector machines (SVMs), and others to determine the importance of various features that contribute to a city’s smartness. Our findings reveal that while smart living was the most critical factor, with an importance of 0.259014. Smart mobility and smart environment also played significant roles, with the importance of 0.170147 and 0.163159, respectively, in determining a city’s smartness. While the clustering provides insights into the similarities and groupings among cities, the feature importance analysis elucidates the critical factors that drive these classifications. The integration of these two approaches aims to demonstrate that understanding the similarities between smart cities is of limited utility without a clear comprehension of the importance of the underlying features. This holistic approach provides a comprehensive understanding of what makes a city ’smart’ and offers a robust framework for policymakers to enhance urban living standards.