Cities worldwide are attempting to be labelled as smart, but truly classifying as such remains a great challenge. This study aims to use artificial intelligence (AI) to classify the performance of smart cities and identify the factors linked to their smartness. Based on residents’ perceptions of urban structures and technological applications, this study included 200 cities globally. For 147 cities, we gathered the perceptions of 120 residents per city through a survey of 39 questions covering two main pillars: ‘Structures’, referring to the existing infrastructure of the city, and the ‘Technology’ pillar that describes the technological provisions and services available to the inhabitants. These pillars were evaluated across five key areas: health and safety, mobility, activities, opportunities, and governance. For the remaining 53 cities, scores were derived by analyzing pertinent data collected from various online resources. Multiple machine learning algorithms, including Random Forest, Artificial Neural Network, Support Vector Machine, and Gradient Boost, were tested and compared in order to select the best one. The results showed that Random Forest and the Artificial Neural Network are the best trained models that achieved the highest levels of accuracy. This study provides a robust framework for using machine learning to identify and assess smart cities, offering valuable insights for future research and urban planning.