Objectives A nationwide spatial analysis of community retail food environments in relation to area socioeconomic deprivation was conducted in New Zealand.Methods Addresses from about 20,000 registered food outlets were retrieved from all 66 Councils. Outlets were classified, geocoded and (spatially) validated. The analysis included 4087 convenience, 4316 fast food/takeaway and 1271 supermarket and fruit/vegetable outlets and excluded outlets not considered 'healthy' or 'unhealthy'. The population-weighted density of different outlet types in Census areas and the proximity to different outlet types from Meshblock centres were calculated and associations with area socioeconomic deprivation assessed. Spatial scan statistics was used to identify food swamp areas with a significantly higher relative density of unhealthy outlets than other areas. Results A significantly positive association was observed between area deprivation and density of all retailers. A significantly negative association was observed between area deprivation and proximity to all retailers. Nationwide, 722 Census areas were identified as food swamps. Conclusions Access to food retailers is significantly higher in more deprived areas than in less deprived areas. Restricting unhealthy outlets in areas with a high relative density of those outlets is recommended.