In this paper, we introduce a completely new approach to fitting rectangles and squares to given closed regions using our published ideas in [6], [7], [8]. In these papers, we have developed a new region-based fitting method using the method of normalization. There we demonstrate the zero-parametric fitting of lines, triangles, parallelograms, circles and ellipses, and the one-parametric fitting of elliptical segments, circular segments and super-ellipses. In the present paper, we discuss this normalization idea for fitting of closed regions using rectangles and squares . As features we use the area-based low order moments. The main problem is a stable normalization of the rotation. We show that we have to solve only an one-dimensional optimization problem in the case of rectangles. In the case of squares there are no free parameters to determine. The presented algorithm is used in practice for document recognition.