Background: Exposure to temperature variability has been associated with increased risk of mortality and morbidity. We aimed to evaluate whether the association between short-term temperature variability and hospitalisation was affected by local socioeconomic level in Brazil. Methods: In this time-series study, we collected city-level socioeconomic data, and daily hospitalisation and weather data from 1814 Brazilian cities between Jan 1, 2000, and Dec 31, 2015. All-cause and cause-specific hospitalisation data was from the Hospital Information System of the Unified Health System in Brazil. City-specific daily minimum and maximum temperatures came from a 0·25° × 0·25° Brazilian meteorological dataset. We represented city-specific socioeconomic level using literacy rate, urbanisation rate, average monthly household income per capita (using the 2000 and 2010 Brazilian census), and GDP per capita (using statistics from the Brazilian Institute of Geography and Statistics for 2000–15), and cities were categorised according to the 2015 World Bank standard. We used quasi-Poisson regression to do time-series analyses and obtain city-specific associations between temperature variability and hospitalisation. We pooled city-specific estimates according to different socioeconomic quartiles or levels using random-effect meta-analyses. Meta-regressions adjusting for demographic and climatic characteristics were used to evaluate the modification effect of city-level socioeconomic indicators on the association between temperature variability and hospitalisation. Findings: We included a total of 147 959 243 hospitalisations (59·0% female) during the study period. Overall, we estimated that the hospitalisation risk due to every 1°C increase in the temperature variability in the current and previous day (TV0–1) increased by 0·52% (95% CI 0·50−0·55). For lower-middle-income cities, this risk was 0·63% (95% CI 0·58–0·69), for upper-middle-income cities it was 0·50% (0·47–0·53), and for high-income cities it was 0·39% (0·33–0·46). The socioeconomic inequality in vulnerability to TV0–1 was especially evident for people aged 0–19 years (effect estimate 1·21% [1·11–1·31] for lower-middle income vs 0·52% [0·41–0·63] for high income) and people aged 60 years or older (0·60% [0·50–0·70] vs 0·43% [0·31–0·56]), and for hospitalisation due to infectious diseases (1·62% [1·46–1·78] vs 0·56% [0·30–0·82]), respiratory diseases (1·32% [1·20–1·44] vs 0·55% [0·37–0·74]), and endocrine diseases (1·21% [0·99–1·43] vs 0·32% [0·02–0·62]). Interpretation: People living in less developed cities in Brazil were more vulnerable to hospitalisation related to temperature variability. This disparity could exacerbate existing health and socioeconomic inequalities in Brazil, and it suggests that more attention should be paid to less developed areas to mitigate the adverse health effects of short-term temperature fluctuations. Funding: None.