We present a power-fit formula, obtained from a variational analysis using three-dimensional free-electron laser theory, for the gain length of a high-gain free-electron laser’s fundamental mode in the presence of diffraction, uncorrelated energy spread, and longitudinal space-charge effects. The approach is inspired by the work of Xie [Nucl. Instrum. Methods Phys. Res., Sect. A 445, 59 (2000)], and provides a useful shortcut for calculating the gain length of the fundamental Gaussian mode of a free-electron laser having strong space-charge effects in the 3D regime. The results derived from analytic theory are in good agreement with detailed numerical particle simulations that also include higher-order space-charge effects, supporting the assumptions made in the theoretical treatment and the variational solutions obtained in the single-mode limit.