There have been numerous studies on Hardy’s inequality on a bounded domain, which holds for functions vanishing on the boundary. On the other hand, the classical Legendre differential equation defined in an interval can be regarded as a Neumann version of the Hardy inequality with subcritical weight functions. In this paper we study a Neumann version of the Hardy inequality on a bounded C2-domain in Rn of the following form (formula presented) where d(x) is the distance from x ∈ Ω to the boundary ∂Ω andα, β ∈ R. We classify all (α, β) ∈ R2 for which C(α, β) > 0. Then, we study whether an optimal constant C(α, β) is attained or not. Our study on C(α, β) for general (α, β) ∈ R2 shows that the (classical) Hardy inequality can be regarded as a special case of the Neumann version.