We show that the thermodynamics of a system of strings at high energy densities under the ideal gas approximation has a formulation in terms of Hamilton-Jacobi theory. The two parameters of the system, which have dimensions of energy density and number density, respectively, define a family of hypersurfaces of co-dimension one, which can be described by the vanishing of a function F that plays the role of a Hamiltonian.