Residential domestic hot water energy consumption represented 16% of the EU household heating demand in 2013. With the improvement of the building insulation envelope, domestic hot water contribution to energy consumption is expected to increase significantly, with values between 20% and 32% in single family buildings, and between 35% to almost 50% in multifamily buildings. This energy, currently lost to the environment, can be recovered by waste water heat recovery systems inside buildings (in building solutions). While most publications in this field focus on shower heat recovery and on waste water as heat source for heat pumps, the detailed impact of waste water heat recovery at a city scale by aggregating building data has not been addressed yet. Furthermore, waste water heat recovery potential and relevance was not yet quantified as a function of the specific inhabitant and household numbers, end-use occurrence, and building type and age. A method to quantify the building-specific energy cost and energy saving potentials, based on pinch analysis, at the urban scale of in-building waste water heat recovery systems is therefore proposed. A complementary method to spatially allocate and characterise grey water streams as to thermal load and temperature levels in function of the building specificities is also developed. These methods are applied in two case studies, first as retrofitting solution in a city in Luxembourg and, second, as optimisation measure for high efficiency residential buildings. Grey water heat recovery would reduce the residential fuel consumption of the city by 63%. An integrated approach combining grey water heat recovery for hot water preheating and a heat pump yields up to 28% and 41% electricity savings for passive single family houses and multifamily buildings, respectively. With the detailed characterisation of various grey water streams as a function of inhabitant number and end -use occurrence, the quantification of the energy savings and costs through heat recovery is improved. The outcomes of urban energy and cost assessments concerning grey water heat recovery are more specific, as the results at building level are aggregated to the considered geographical scope. The proposed method therefore complements current urban energy and cost assessments with the detailed integration of in -building grey water heat recovery systems. (C) 2017 Published by Elsevier Ltd.