It is known that for any Sobolev function in the space W m , p ( R N ) , p ⩾ 1 , m p ⩽ N , where m is a nonnegative integer, the set of its singular points has Hausdorff dimension at most N − m p . We show that for p > 1 this bound can be achieved. This is done by constructing a maximally singular Sobolev function in W m , p ( R N ) , that is, such that Hausdorff's dimension of its singular set is equal to N − m p . An analogous result holds also for Bessel potential spaces L α , p ( R N ) , provided α p < N , α > 0 , and p > 1 . The existence of maximally singular Sobolev functions has been announced in [Chaos Solitons Fractals 21 (2004), p. 1287].