Electrocatalytic upgrading of wasted plastic and renewable biomass represents a sustainable method to produce chemicals but is limited to carbohydrates, leaving other value-added chemicals, such as organonitrogen compounds, being scarcely explored. Herein, we reported an electrocatalytic oxidation strategy to transform polyethylene terephthalate (PET) plastic-derived ethylene glycol (EG) and biomass-derived polyols into formamide, in the presence of ammonia (NH3) over a tungsten oxide (WO3) catalyst. Taking EG-to-formamide as an example, we achieved a high formamide productivity of 537.7 μmol cm-2 h-1 with FE of 43.2 % at a constant current of 100 mA cm-2 in a flow electrolyzer with 12-h test, representing a more advantageous performance compared with previous reports for formamide electrosynthesis. Mechanistic understanding revealed that the cleavage of the C-C bond in the EG was facilitated by nucleophilic attack of in situ formed nitrogen radicals from NH3, with resultant C-N bond construction and eventually formamide production. Furthermore, this strategy can be extended to transformation of PET bottle and a series of biomass-derived polyols with carbon number from three (glycerol) to six (glucose), producing formamide with high efficiencies. This work demonstrates a sustainable upgrading strategy of plastic and biomass that may have implications to more value-added chemicals production beyond carbohydrates.