The paper presents the current status of the theory of bound-electron g factor in highly charged ions. The calculations of the relativistic, QED, nuclear recoil, nuclear structure, and interelectronic-interaction corrections to the g factor are reviewed. Special attention is paid to tests of QED effects at strong coupling regime and determinations of the fundamental constants.