Here, I provide a perspective on digital twins of cities that cover a wide array of different types, ranging from aggregate economic and behavioral processes to more disaggregate agent-based, cellular and micro-simulations. A key element in these applications is the way that we as scientists, policymakers and planners interact with real cities with respect to their understanding, prediction and design. I note a range of spatial models, from analytical simulations of local neighborhoods to large-scale systems of cities and city systems, and briefly describe computational challenges that geospatial applications in cities pose. Although digital twins first originated as models of physical systems, they are rapidly being applied to social systems, such as cities. This Perspective discusses the development and use of digital twins for urban planning.