Using ab initio methods based on density functional theory, the electronic and magnetic structure of layered hexagonal NbSe2 is studied. In the case of single-layer NbSe2 it is found that, for all the functionals considered, the magnetic solution is lower in energy than the non-magnetic solution. The magnetic ground-state is ferrimagnetic with a magnetic moment of 1.09 μB at the Nb atoms and a magnetic moment of 0.05 μB, in the opposite direction, at the Se atoms. Our calculations show that single-layer NbSe2 does not display a charge density wave instability unless a graphene layer is considered as a substrate. Then, two kinds of 3×3 charge density waves are found, which are observed in our STM experiments. This suggest that the driving force of charge instabilities in NbSe2 differ in bulk and in the single-layer limit. Our work sets magnetism into play in this highly-correlated 2D material, which is crucial to understand the formation mechanisms of 2D superconductivity and charge density wave order.