This paper describes a simple computer program which calculates the magnetic fieldBinside the bore of any system of coaxial uniform current density solenoid of rectangular cross section using Garrett's method [J. Appl Phys.22, 1091 (1951)]. Two versions of the program exist, the first in the Dartmouth form of the language BASIC, the second in the language FORTRAN IV. Both versions are ideally suited to modern digital computers, including time shared computers. Copies or listings of the programs are available upon request. The programs are based on those used to design a miniature superconducting magnet for dip experiments.