Nickel-catalyzed hydrocyanation of 1,3-butadiene with hydrogen cyanide gas is the predominant method for the synthesis of adiponitrile, which is an important precursor for polymer production. However, the use of fossil-derived alkenes raises environmental concerns, and hydrogen cyanide is highly volatile and extremely toxic. Herein, we report the use of biomass-derived 1,4-butanediol, as well as other primary alcohols, for photochemical synthesis of linear and branched nitriles and dinitriles, including adiponitrile, with 1,4-dicyanobenzene as the CN source. This mild, sustainable method does not require hydrogen cyanide gas or an air- or moisture-sensitive metal catalyst and is applicable for the production of dinitriles as precursors of diamines, which have potential utility for the development of novel polyamides.