We present a generic method for the numerical calculation of the magnetic dipolar anisotropy energy applicable to rough thin films. The dipolar energy is calculated by considering the magnetostatic interaction between the surface magnetization induced at the surface of a thin film. By using the present method. we have quantitatively evaluated the reduction of the dipolar anisotropy and the existence of the surface dipolar anisotropy due to the magnetic dipoles induced at the rough surface of magnetic thin films. The present method has been applied to a real system of Ni/Pt multilayers exhibiting rough surface, and the dipolar anisotropy energy was revealed to be reduced more than 10%, compared to the value for the perfectly flat film. The present calculation has been confirmed to satisfy the sum rule within an accuracy of 1%. (C) 2000 Elsevier Science B.V. All rights reserved.