The electronic g-tensor calculations are performed for dangling bonds (DBs) introduced into nanodiamonds (NDs) with four different functional groups on their surfaces. For hydrogenated and fluorinated NDs, it is found that g-shifts of the latter vary in a much wider range, and the same is also true for the total energy differences between the highest and the lowest energy DBs. In addition, it is shown that the shape of NDs significantly impacts the energetics and g-shifts of DBs, whereas the influence of the size is much less pronounced, as is the influence of the presence of one DB in the vicinity of the other, resulting in no substantial change on their magnetic behavior. For hydroxylated and aminated NDs, it is demonstrated that the variation range of g-shifts is larger for the former, whereas the opposite is seen regarding the total energy differences. On the whole, some of the positions of DBs can be energetically very costly in these NDs; besides, the lowest energy DBs are irregular, that is, formed by OH-and NH 2 -bonded C atoms, contrasting with hydrogenated and fluorinated NDs, for which irregular DBs are the most energetically unfavorable.