We show an estimate of the fractal and Hausdorff dimension of sets invariant with respect to families of transformations. This estimate is proved under assumption that the transformations satisfy a squeezing property which is more general than the Lipschitz condition. Our results generalize the classical Moran formula [Moran PAP. Additive functions of intervals and Hausdorff measure. Proc Camb Philos Soc 1946;42:15–23].