The gap profile of a two-dimensional self-acting gas bearing is determined such that the static stiffness it can achieve is maximum. Three fundamental profiles are obtained according to the stiffness mode to be considered: normal, pitch, or roll. The optimization process takes place within the framework of the compressible lubrication theory among all the profiles having a given minimum film thickness. The method proposed here is based on the calculus of variations and uses a finite element technique coupled with an iterative mapping to converge to the final solution. As an example, the case of a square bearing is treated and the three fundamental gap profiles, along with their optimum characteristics, are plotted to illustrate the solutions.