We investigated the reaction paths of Stone-Wales rearrangement (SWR), i.e., π/2 rotation of two carbon atoms with respect to the midpoint of the bond, in graphene and carbon nanotube quantum chemically. Our particular attention is focused on the roles of electronic excitations and conical intersections (CIs) in the reaction mechanism. We used pyrene as a model system. The reaction paths were determined by constructing potential energy surfaces at the MS-CASPT2//SA-CASSCF level of theory. We found that there are no CIs involved in SWR when both of C-C bond cleavage and formation occur simultaneously (concerted mechanism). In contrast, for the reaction path with stepwise cleavage and formation of C-C bonds, C-C bond breaking and making processes proceed through two CIs. When SWR starts from the ground (S 0) state, the concerted and stepwise paths have an equivalent reaction barrier ΔE‡ (9.5-9.6 eV). For the reaction path starting from excited states, only the stepwise mechanism is energetically preferable. This path contains a nonadabatic transition between the S 1 and S0 states via a CI associated with the first stage of C-C bond cleavage and has ΔE‡ as large as in the S0 paths. We confirmed that the main active molecular orbitals and electron configurations for the low-lying electronic states of larger nanocarbons are the same as those in pyrene. This result suggests the importance of the nonadiabatic transitions through CIs in the photochemical reactions in large nanocarbons.