Nonlinear least-squares inversion of traveltime data is applied to the problem of determining thicknesses, velocities, and velocity gradients in laterally homogeneous, horizontally layered structures. The parametric forms of the traveltime equations are used for the calculations. Results of inversions on randomly inaccurate synthetic data show that the method will not determine the gradient consistently when using reflection traveltimes. Good results are obtained, however, when using traveltimes of energy refracted in a layer by the velocity gradient. Thicknesses and average velocity in the case of reflections, or velocity at the top of the layer in the case of refractions, are also determined. Partial derivatives determined during the course of the least-squares inversion can be used to place limits on errors in the determined parameters.