The competitive 1,5‐electrocyclization versus intramolecular 1,5‐proton shift in imidazolium allylides and imidazolium 2‐phosphaallylides has been investigated theoretically at the DFT (B3LYP/6‐311 + +G**//B3LYP/6‐31G**) level. 1,5‐Electrocyclization follows pericyclic mechanism and its activation barrier is lower than that for the pseudopericyclic mechanism by ∼5–6 kcal mol−1. The activation barriers for 1,5‐electrocyclization of imidazolium 2‐phosphaallylides are found to be smaller than those for their nonphosphorus analogues by ∼3–5 kcal mol−1. There appears to be a good correlation between the activation barrier for intramolecular 1,5‐proton shift and the density of the negative charge at C8, except for the ylides having fluorine substituent at this position (7b and 8b). The presence of fluorine atom reduces the density of the negative charge at C8 (in 7b it becomes positively charged) and thus raises the activation barrier. The ylides 7f and 8f having CF3 group at C8, in preference to the 1,5‐proton shift, follow an alternative route leading to different carbenes which is accompanied by the loss of HF. The carbenes Pr7,8b–e resulting from intramolecular 1,5‐proton shift have a strong tendency to undergo intramolecular SN2 type reaction, the activation barrier being 7–28 kcal mol−1. Copyright © 2011 John Wiley & Sons, Ltd.