In an effort to improve tools for effective flood risk assessment, we applied machine learning algorithms to predict flood-prone areas in Amol city (Iran), a site with recent floods (2017–2018). An ensemble approach was then implemented to predict hazard probabilities using the best machine learning algorithms (boosted regression tree, multivariate adaptive regression spline, generalized linear model, and generalized additive model) based on a receiver operator characteristic-area under the curve assessment. The algorithms were all trained and tested on 92 randomly selected points, information from a flood inundation survey, and geospatial predictor variables (precipitation, land use, elevation, slope percent, curve number, distance to river, distance to channel, and depth to groundwater). The ensemble model had 0.925 and 0.892 accuracy for training and testing data, respectively. We then created a vulnerability map from data on building density, building age, population density, and socio-economic conditions and assessed risk as a product of hazard and vulnerability. The results indicated that distance to channel, land use, and runoff generation were the most important factors associated with flood hazard, while population density and building density were the most important factors determining vulnerability. Areas of highest and lowest flood risks were identified, leading to recommendations on where to implement flood risk reduction measures to guide flood governance in Amol city.