We construct families of optimal Hardy-weights for a subcritical linear second-order elliptic operator using a one-dimensional reduction. More precisely, we first characterize all optimal Hardy-weights with respect to one-dimensional subcritical Sturm-Liouville operators on (a, b), ∞ ≤ a < b ≤ ∞, and then apply this result to obtain families of optimal Hardy inequalities for general linear second-order elliptic operators in higher dimensions. As an application, we prove a new Rellich inequality.2000 Mathematics Subject Classification. Primary 35B09; Secondary 35J08, 35J20, 47J20, 49J40.