The effect of terrain on gravity measurements in a borehole and on formation density derived from borehole gravity data is studied as a function of depth in the well, terrain elevation, terrain inclination, and radial distance to the terrain feature. The vertical attraction of gravity g T in a borehole resulting from a terrain element is small at the surface and reaches an absolute maximum at a depth of about one and one-half times the radial distance to the terrain element, then decreases at greater depths. The effect of terrain on calculated formation density is proportional to the vertical derivative of g T and is maximum at the surface, passes through zero where g T is greatest, and reaches a second extremum of opposite sign to the first and of much lower magnitude. Accuracy criteria for borehole-gravity terrain corrections show that elevation accuracy requirements are most stringent for a combination of nearby terrain features and near-surface gravity stations. Sensitivity to terrain inclination is also greatest for this combination. The measurement of the free-air gradient of gravity, commonly made slightly above the ground surface, is extremely sensitive to topographic irregularities within about 300m of the measurement point. The effect of terrain features 21.9 to 166.7 km from the well [Hammer's (1939) zone M through Hayford-Bowie's (1912) zone O] on calculated formation density is nearly constant with depth. At these distances, the terrain correction will be equivalent to a dc shift of about 0.053 g/cm 3 /1000 m of average elevation above or below the correction datum. The effect of topography beyond 166.7 km is not likely to exceed 0.01 g/cm 3 .