We combine analytic developments and numerical tight-binding calculations to study the evolution of the electron g-factors in homogeneous nanostructures of III-V and II-VI semiconductors. We demonstrate that the g-factor can be always written as a sum of bulk and surface terms. The bulk term, the dominant one, just depends on the energy gap of the nanostructure but is otherwise isotropic and independent of size, shape, and dimensionality. At the same time, the magnetic moment density at the origin of the bulk term is anisotropic and strongly dependents on the nanostructure shape. The physical origin of these seemingly contradictory findings is explained by the relation between the spin-orbit-induced currents and the spatial derivatives of the electron envelope wave function. The tight-binding calculations show that the g-factor versus energy gap for spherical nanocrystals can be used as a reference curve. In quantum wells, nanoplatelets, nanorods, and nanowires, the g-factor along the rotational symmetry axis can be predicted from the reference curve with a good accuracy. The g-factors along nonsymmetric axes exhibit more important deviations due to surface contributions but the energy gap remains the main quantity determining their evolution. The importance of surface-induced anisotropies of the g-factors is discussed.