Considering regular mappings of Euclidean spaces, we study the distortion of the Hausdorff dimension of a given set under restrictions on the rank of the gradient on the set. This problem was solved for the classical cases of k-smooth and Hölder mappings by Dubovitskii, Bates, and Moreira. We solve the problem for Sobolev and fractional Sobolev classes as well. Here we study the Sobolev case under minimal integrability assumptions that guarantee in general only the continuity of a mapping (rather than differentiability everywhere). Some new facts are found out in the classical smooth case. The proofs are mostly based on our previous joint papers with Bourgain and Kristensen (2013, 2015).