Handwashing with water and soap is among the most a cost-effective interventions to improve public health. Yet billions of people globally lacking handwashing facilities with water and soap on premises, with gaps particularly found in low- and middle-income countries. Targeted efforts to expand access to basic hygiene services require data at geospatially explicit scales. Drawing on country-specific cross-sectional Demographic and Health Surveys with georeferenced hygiene data, we developed an ensemble machine learning model to predict the prevalence of basic hygiene facilities in Malawi, Nepal, Nigeria, Pakistan and Uganda. The ensemble model was based on a multiple-level stacking structure, where four predictive modelling algorithms were used to produce sub-models, and a random forest model was used to generalise the final predictions. An inverse distance weighted interpolation was incorporated in the random forest model to account for spatial autocorrelation. Local coverage and a local dissimilarity index were calculated to examine the geographic disparities in access. Our methodology produced robust outputs, as evidenced by performance evaluations (all R2 were above 0.8). Among the five study countries, Pakistan had the highest overall coverage, whilst Malawi had the poorest coverage. Apparent disparities in basic hygiene services measured by local coverage were found across geographic locations and between urban and rural settings. Nigeria had the highest level of inequalities in basic hygiene services measured by a dissimilarity index, whilst Malawi showed the least segregation between populations with and without basic hygiene services. Both educational attainment and wealth were important predictors of the geospatial distribution of basic hygiene services. By producing geospatially explicit estimates of the prevalence of handwashing facilities with water and soap, this study provides a means of identifying geographical disparities in basic hygiene services. The method and outputs can be useful tools to identify areas of low coverage and to support efficient and precise targeting of efforts to scale up access to handwashing facilities and shift social and cultural norms on handwashing.