The Wolff rearrangement is a 1,2-rearrangement reaction of α-diazocarbonyl compounds, leading to ketene formation and the extrusion of nitrogen. The reaction may undergo a concerted mechanism or involve a carbene as an intermediate. There is also the possibility of its rearrangement to oxirene. In this work, we have performed density functional calculations to elucidate the mechanism of the thermal Wolff reaction for both the gas and aqueous phases. The concerted mechanism appears to be slightly favored over the stepwise mechanism for alkyl and aryl substitution of the aldehydic hydrogen. Various diazocarbonyl systems have been investigated in order to explore the influence of the migrating group on the activation barrier and course of reaction. The stepwise rearrangement is preferred in case of methoxy and amino substitution. The intermediate in the stepwise rearrangement is found to have an interesting structure, neither completely a carbene nor an oxirene.