In the present work, we investigate the viscosity evolution of heavy oil by peroxide oxidation and successive thermal pyrolysis. Our results show that, the oxidation majorly occurs in the aromatic hydrocarbon (AH), which may debranch the side chains of aromatic derivatives forming isolated long-chain carboxylic acids, or introduce carboxyl to the tail of the branch chains in aromatic structures. The elevated interactions between adjacent debranched side chains in AH as well as condensation of the AH fragments will occur, which will transfer the AH components to resins and result in a quasi-linear correlation between the viscosity and total acid number (TAN) of heavy oil. Upon pyrolysis, resins in original heavy oil will be fragmented accompanied with decarboxylation; while the prior oxidation to heavy oil, although increases the viscosity, will benefit the fragmentation and decarboxylation, leading to approximate viscosity reduction behavior. Our work reveals that the oxygen content should be an important factor that contributes to the high viscosity of heavy oil, which could render reliable reference for developing new strategies to efficiently recover heavy oil reservoirs.