The CATEF program for the calculation of potential distribution in accelerating tubes is presented. It includes the finite difference method-superrelaxation technique for calculating potential distribution and the Rouge-Kouta method for particle trajectories. The CATEF can also be used in electric field design of other electron optical parts. The three dimensional CATEF is suitable for the calculation and design of complex electric field.