The contrast between ecology in cities and ecology of cities has emphasized the increasing scope of urban ecosystem research. Ecology in focuses on terrestrial and aquatic patches within cities, suburbs, and exurbs as analogs of non‐urban habitats. Urban fabric outside analog patches is considered to be inhospitable matrix. Ecology of the city differs from ecology in by treating entire urban mosaics as social–ecological systems. Ecology of urban ecosystems incorporates biological, social, and built components. Originally posed as a metaphor to visualize disciplinary evolution, this paper suggests that the contrast has conceptual, empirical, and methodological contents. That is, the contrast constitutes a disciplinary or “local” paradigm shift. The paradigm change between ecology in and ecology of represents increased complexity, moving from focus on biotic communities to holistic social–ecological systems. A third paradigm, ecology for the city, has emerged due to concern for urban sustainability. While ecology for includes the knowledge generated by both ecology in and ecology of, it considers researchers as a part of the system, and acknowledges that they may help envision and advance the social goals of urban sustainability. Using urban heterogeneity as a key urban feature, the three paradigms are shown to contrast in five important ways: disciplinary focus, the relevant theory of spatial heterogeneity, the technology for representing spatial structure, the resulting classification of urban mosaics, and the nature of application to sustainability. Ecology for the city encourages ecologists to engage with other specialists and urban dwellers to shape a more sustainable urban future.