Evidencing enhanced charge-transfer with superior photocatalytic degradation and photoelectrochemical water splitting in Mg modified few-layered SnS2.