In this paper, we prove that the distance function of an open connected set in R n+1 with a C 2 boundary is superharmonic in the distribution sense if and only if the boundary is weakly mean convex. We then prove that Hardy inequalities with a sharp constant hold on weakly mean convex C 2 domains. Moreover, we show that the weakly mean convexity condition cannot be weakened. We also prove various improved Hardy inequalities on mean convex domains along the line of Brezis and Marcus (1997) . © 2012.