In this paper, we propose a novel explicit equation for friction factor, which is valid for both smooth and rough wall turbulent flows in pipes and channels. The form of the proposed equation is based on a new logarithmic velocity profile and the model constants are obtained by using the experimental data available in the literature. The proposed equation gives the friction factor explicitly as a function of Reynolds number and relative roughness. The results indicate that the present model gives a very good prediction of the friction factor and can reproduce the Colebrook equation and its Moody plot. Therefore, the new approximation for the friction factor provides a rational, accurate, and practically useful method over the entire range of the Moody chart in terms of Reynolds number and relative roughness.