Urban flood models that use Digital Elevation Models (DEMs) to simulate extent and depth of flood inundation rely on the accuracy of DEMs for predicting flood events. Despite recent advances in developing vegetation corrected DEMs, the effect of building height and density errors in global DEMs in urban areas are still poorly understood, and their correction remains a challenge. In this research we developed a methodology for building error correction that can be applied to any other case study, where building density data and a local reference DEM data are available. This methodology was applied to Nairobi, Kenya using six global DEMs (SRTM, MERIT, ALOS, NASADEM, TanDEM-X 12 m, and TanDEM-X 90 m DEM). Our results show building error at highest building density varying between 1.25 m and 5.07 m for the DEMs used, with the MERIT DEM showing the smallest vertical height error from the reference DEM. The six DEMs were corrected by deriving a linear relationship between building density and DEM error. Our findings show that the removal of building density error resulted in the improvement of the vertical height accuracy of the global DEMs of up to 45% for MERIT and 40% for ALOS. This methodology was also applied to the Central Business District (CBD) area of Nairobi, characterized by taller buildings and high building density. The error parameters in the CBD area resulted to be between 15 to 45% higher than those of the Nairobi city wide area for the six global DEMs, thus providing further insights into the contribution of building heights to errors in global DEMs. Building height data is still unavailable on a global scale and our results show that global DEMs can be usefully corrected for building density errors in urban areas, even where specific building height data are not available.