This study employs DMSP-OLS and NPP-VIIS nighttime light remote sensing data to develop a carbon emission regression model based on energy consumption, analyzing the spatiotemporal evolution of carbon emissions in 57 cities within the Yellow River Basin from 2012 to 2021. The analysis uses a quantile regression model to identify factors affecting carbon emissions, aiming to enhance the basin’s emission mechanism and foster low-carbon development. Key findings include: 1) Carbon emissions from energy consumption increased in this period, with a decreasing growth rate. 2) Emissions were concentrated along the Yellow River and its tributaries, forming high-density carbon emission centers. 3) The Yellow River Basin has mainly formed a “high-high” agglomeration area centered on resource-based cities such as Shanxi and Inner Mongolia’s coal, and a “low-low” agglomeration area centered on Gansu and Ningxia. The standard deviation ellipse of carbon emissions in the Yellow River Basin generally extends from east to west, and its center of gravity tends to move northward during the study period. 4) Technological innovation, economic development, and population agglomeration suppressed emissions, with digital economy and foreign investment increasing them in certain cities. Urbanization correlated positively with emissions, but adjusting a single industrial structure showed insignificant impact.