The Nb-based oxynitrides and nitrides are synthesized by NH3 nitridation method. Nb-based compounds were dual-functionally applied to DSSCs and anaerobic digestion. The Nb3.49N4.56O0.44 CE shows markedly electrocatalytic activity in DSSCs. The Nb-based compounds are firstly utilized as accelerants in anaerobic digestion.