The peroxyl radical scavenging activity of four hydroxycinnamic acid derivatives (HCAD) has been studied in non-polar and aqueous solutions, using the density functional theory. The studied HCAD are: ferulic acid (4-hydroxy-3-methoxycinnamic acid), p-coumaric acid (trans-4-hydroxycinnamic acid), caffeic acid (3,4-dihydroxycinnamic acid), and dihydrocaffeic acid (3-(3,4-dihydroxyphenyl)-2-propionic acid). It was found that the polarity of the environment plays an important role in the relative efficiency of these compounds as peroxyl scavengers. It was also found that in aqueous solution the pH is a key factor for the overall reactivity of HCAD towards peroxyl radicals, for their relative antioxidant capacity, and for the relative importance of the different mechanisms of reaction. The H transfer from the phenolic OH has been identified as the main mechanism of reaction in non-polar media and in aqueous solution at acid pHs. On the other hand, the single electron transfer mechanism from the phenoxide anion is proposed to be the one contributing the most to the overall peroxyl scavenging activity of HCAD in aqueous solution at physiological pH (7.4). This process is also predicted to be a key factor in the reactivity of these compounds towards a large variety of free radicals.