A Jacobian formulation of the pressure gradient farce for use in models with topography-following coordinates is proposed. II can be used in conjunction with any vertical coordinate system and is easily implemented. Vertical variations in the pressure gradient are expressed in terms of a vertical integral of the Jacobian of density and depth with respect to the vertical computational coordinate. Finite difference approximations are made on the density held, consistent with piecewise linear and continuous fields, and accurate pressure gradients are obtained by vertically integrating the discrete Jacobian from sea surface. Two discrete schemes are derived and examined in detail: the first using standard centered differencing in the generalized vertical coordinate and the second using a vertical weighting such that the finite differences are centered with respect to the Cartesian z coordinate. Both schemes achieve second-order accuracy for any vertical coordinate system and are significantly more accurate than conventional schemes based on estimating the pressure gradients by finite differencing a previously determined pressure field. The standard Jacobian formulation is constructed to give exact pressure gradient results, independent of the bottom topography, if the buoyancy field varies bilinearly with horizontal position, x, and the generalized vertical coordinate, s, over each grid cell. Similarly, the weighted Jacobian scheme is designed to achieve exact results, when the buoyancy field varies linearly with z and arbitrarily with x, that is, b(x,z) = b(0)(x) + b(1)(x)z. When horizontal resolution cannot be made fine enough to avoid hydrostatic inconsistency, errors can be substantially reduced by the choice of an appropriate vertical coordinate. Tests with horizontally uniform, vertically varying, and with horizontally and vertically varying buoyancy fields show that the standard Jacobian formulation achieves superior results when the condition for hydrostatic consistency is satisfied, but when coarse horizontal resolution causes this condition to be strongly violated, the weighted Jacobian may give superior results.