Sanitary surveys are used in low- and middle-income countries to assess water, sanitation, and hygiene conditions, but have rarely been compared with direct measures of environmental fecal contamination. We conducted a cross-sectional assessment of sanitary conditions and E. coli counts in soils and on surfaces of compounds (household clusters) in low-income neighborhoods of Maputo, Mozambique. We adapted the World Bank's Urban Sanitation Status Index to implement a sanitary survey tool specifically for compounds: a Localized Sanitation Status Index (LSSI) ranging from zero (poor sanitary conditions) to one (better sanitary conditions) calculated from 20 variables that characterized local sanitary conditions. We measured the variation in the LSSI with E. coli counts in soil (nine locations/compound) and surface swabs (seven locations/compound) in 80 compounds to assess reliability. Multivariable regression indicated that a ten-percentage point increase in LSSI was associated with 0.05 (95% CI: 0.00, 0.11) log10 fewer E. coli/dry gram in courtyard soil. Overall, the LSSI may be associated with fecal contamination in compound soil; however, the differences detected may not be meaningful in terms of public health hazards.