Abstract. Let X be a metric space equipped with a doubling measure. We consider weights w(x) = dist(x, E) −α , where E is a closed set in X and α ∈ R. We establish sharp conditions, based on the Assouad (co)dimension of E, for the inclusion of w in Muckenhoupt's A p classes of weights, 1 ≤ p < ∞. With the help of general A p -weighted embedding results, we then prove (global) Hardy-Sobolev inequalities and also fractional versions of such inequalities in the setting of metric spaces.