We prove new bounds on the dimensions of distance sets and pinned distance sets of planar sets. Among other results, we show that if A ⊂ R 2 is a Borel set of Hausdorff dimension s > 1, then its distance set has Hausdorff dimension at least 37/54 ≈ 0.685. Moreover, if s ∈ (1, 3/2], then outside of a set of exceptional y of Hausdorff dimension at most 1, the pinned distance set {|x − y| : x ∈ A} has Hausdorff dimension ≥ 2 3 s and packing dimension at least 1 4 (1 + s + 3s(2 − s)) ≥ 0.933. These estimates improve upon the existing ones by Bourgain, Wolff, Peres-Schlag and Iosevich-Liu for sets of Hausdorff dimension > 1. Our proof uses a multiscale decomposition of measures in which, unlike previous works, we are able to choose the scales subject to certain constrains. This leads to a combinatorial problem, which is a key new ingredient of our approach, and which we solve completely by optimizing certain variation of Lipschitz functions.2010 Mathematics Subject Classification. Primary: 28A75, 28A80; Secondary: 26A16, 49Q15.