Calculation of the potential field inside a three-dimensional box with the normal magnetic field component given on all boundaries is needed for estimation of important quantities related to the magnetic field such as free energy and relative helicity. In this work we present an analysis of three methods for calculating potential field inside a three-dimensional box. The accuracy and performance of the methods are tested on artificial models with a priori known solutions.