A method of calculating magnetostatic energy is studied by a two‐dimensional approximation. This is required in order to analyze the domain structure of a magnetic thin film. The energy Es is calculated as the product of demagnetization field Hd and magnetization M. Since Hd varies widely within a domain, Es must be calculated in a number of subdivided regions in which Hd is assumed to be uniform, and their summation is calculated. Good precision can be achieved by subdividing a domain along possible charged surfaces. The closure domain structure of a rectangular film whose triangular domain has an extra wall is thus analyzed. Although the total energy of the film is increased by the addition of an extra wall, the local energy of the triangular domain has a negative minimum value when the magnetization direction is inclined. The calculated magnetization direction corresponding to the minimum energy agrees with the observation by scanning electron microscopy. Thus, it becomes clear that this domain structure can be determined in a quasi‐stable condition by precisely calculating the magnetostatic energy.