This study identified food deserts and swamps, investigating their associations with socioeconomic and demographic conditions. This ecological study was conducted using data from urban census tracts in the city of Recife, which were considered the unit of analysis. Information on food retail was obtained from government sources in 2019. Census tracts below the 25th percentile in the density of healthy food retail (i.e., those that predominantly sell natural or minimally processed foods, mixed businesses, and super- and hypermarkets) were classified as food deserts. Census tracts above the 25th percentile in the density of unhealthy food retail (i.e., those selling primarily ultra-processed foods) were considered food swamps. The socioeconomic and demographic conditions of the census tracts were evaluated using variables from the 2010 census (per capita income, average income, race, literacy of the head of household, and the availability of essential services) and the Health Vulnerability Index. Census tracts considered food deserts (28.5%) were more vulnerable, characterized by lower income and access to essential services, more illiterate residents and more minorities (Black/Indigenous/mixed race). Food swamps (73.47%) were more prevalent in less vulnerable neighbourhoods characterized by higher percentages of literate residents and Whites, greater purchasing power, and better basic sanitation. The characteristics of Recife’s food deserts and swamps demonstrate social inequalities in the food environment. Public facilities could play a vital role in promoting healthy eating within food deserts. Additionally, future implementation of taxes on ultra-processed foods and the provision of tax subsidies to natural or minimally processed food sellers might contribute to fostering healthier dietary choices.