The aim of this study was to investigate the association between sociodemographic and environmental contexts on self-rated health. A population-based cross-sectional study with a random sample of 38 neighborhoods (census tracts) and 1,100 adults was carried out. Data analysis used multilevel logistic regression. Data from the Brazilian Census of 2000, mean income, years of study of the head of household and mean number of residents per tract were R$955 (SD = 586), 8 years (SD = 3), and 746 residents (SD = 358) respectively. Higher prevalences of fair/poor self-rated health were found in neighborhoods with greater populations and lower income/schooling levels. After control for individual variables, the odds for fair/poor self-rated health was twice as high in more populous (OR = 2.04; 95%CI: 1.15-3.61) and lower-income neighborhoods (OR = 2.29; 95%CI: 1.16-4.50) compared to less populous, higher-income ones. Self-rated health depends on individual characteristics and the sociodemographic context of neighborhoods.