A potential energy surface for CO2 is determined from experimental data using generalized internal vibrational coordinates. These coordinates are defined as two arbitrary distances and the angle between them and depend on two external parameters, which can be properly optimized. An optimal generalized internal coordinate system is obtained for CO2 by minimizing unconverged vibrational energies with respect to the external parameters. The optimal coordinates are shown to be superior to previously derived normal hyperspherical coordinates for this molecule. A nonlinear least-squares fit of the potential energy surface of CO2 to observed vibrational frequencies is made by using the optimal internal coordinates and fully variational calculations. The potential function is represented by a fourth-order Morse-cosine expansion and its quality is checked by computing highly excited vibrational transition frequencies which were not included in the fit. Copyright 1999 Academic Press.