A thermo-economic optimization method for a hot-water distribution pipe is presented. The method is based on the second law of thermodynamics. Both the optimum pipe diameter and the insulation thickness are determined simultaneously, considering exergy destruction due to friction and exergy loss due to heat losses as the operation cost, while the piping and insulation costs are considered as an investment. The effect of mass flow rate, annual operation time, depreciation period and water temperature on the optimum pipe diameter and insulation thickness are presented with a parametric investigation. The results show that the mass flow rate dominates the optimum pipe diameter. The annual operation time, depreciation period and water temperature are the decision parameters for the optimum insulation thickness. (c) 2007 Journal of Mechanical Engineering. All rights reserved.