4‐Hydroxy‐2‐trans‐nonenal (HNE) is a toxic aldehyde produced mostly in oils containing polyunsaturated fatty acid due to heat‐induced lipid peroxidation. The present study examined the effects of the heating time, the degree of unsaturation, and the antioxidant potential on the formation of HNE in two light olive oils (LOO) and two sunflower oils (one high oleic and one regular) at frying temperature. HNE concentrations in these oil samples heated for 0, 1, 3, and 5 hours at 185 °C were measured using high‐performance liquid chromatography. The fatty‐acid distribution and the antioxidant capacity of these four oils were also analyzed. The results showed that all oils had very low HNE concentrations (<0.5 μg g−1 oil) before heating. After 5 hours of heating at 185 °C, HNE concentrations were increased to 17.98, 25.00, 12.51, and 40.00 μg g−1 in the two LOO, high‐oleic sunflower oil (HOSO), and regular sunflower oil (RSO), respectively. Extending the heating time increased HNE formation in all oils tested. It is related to their fatty‐acid distributions and antioxidant capacities. RSO, which contained high levels of linoleic acid (59.60%), a precursor for HNE, was more susceptible to degradation and HNE formation than HOSO and LOO, which contained only 6–8% linoleic acid.