The g-function is a measure of degrees of freedom associated to a boundary of two-dimensional quantum field theories. In integrable theories, it can be computed exactly in a form of the Fredholm determinant, but it is often hard to evaluate numerically. In this paper, we derive functional equations---or equivalently integral equations of the thermodynamic Bethe ansatz (TBA) type---which directly compute the g-function in the simplest integrable theory; the sinh-Gordon theory at the self-dual point. The derivation is based on the classic result by Tracy and Widom on the relation between Fredholm determinants and TBA, which was used also in the context of topological string. We demonstrate the efficiency of our formulation through the numerical computation and compare the results in the UV limit with the Liouville CFT. As a side result, we present multiple integrals of Q-functions which we conjecture to describe a universal part of the g-function, and discuss its implication to integrable spin chains.