The window remove-restore technique, suggested by Abd-Elmotaal and Kühtreiber (2003) to get rid of the double consideration of the topographic-isostatic masses within the data window, is implemented for the African gravity field recovery in the framework of the activities of the IAG Sub-Commission on the gravity and geoid in Africa. Within the course of the window technique, one needs to compute the effect of the topographic-isostatic masses (terrain correction) for the full data window. Since the African data window is fairly large (-42º ≤ φ ≤ 44º; -22º ≤ λ ≤ 62º), the computation of the effect of the topographic-isostatic masses of the full data window consumes very long CPU time using the common TC-program (Forsberg, 1984). This investigation proposes an optimal terrain correction software for the window remove-restore technique. It uses three radii around the computational point. The first radius is used for the innermost zone utilizing the finest DTM for a relatively short radius (around 2 km). The second radius is used for the inner zone up to a short radius (10-15 km). Here a reasonably fine DTM is sufficient. The third radius is used for the rest of the full data window utilizing a coarse DTM. A thorough comparison between the developed software and the TC-program is performed to assess the quality of the developed technique and to compare the needed CPU time to perform the terrain correction for Africa.