Continuous measurements of nitrous acid (HONO) were performed from December 12 to December 22, 2015 in both urban and suburban areas of Beijing to study the formation mechanism of HONO. The measurement campaign in both sites included a clean-haze-clean transformation process. HONO concentrations showed similar variations in the two sites, while they were always higher in the urban area. Moreover, correlations of HONO with NOx, NO2, NO, PM2.5 and relative humidity (RH) were studied to explore possible HONO formation pathways, and the contributions of direct emissions, heterogeneous reactions, and homogeneous reactions were also calculated. This showed that HONO in urban and suburban areas underwent totally different formation procedures, which were affected by meteorological conditions, PM2.5 concentrations, direct emissions, homogeneous reactions and heterogeneous reactions. PM2.5 concentrations and RH would influence the NO2 conversion efficiency. Heterogeneous reactions of NO2 were more efficient in suburban areas and in clean periods while direct emissions and homogeneous reactions contributed more in urban areas and in polluted periods when the concentrations of NOx and NO were at a high level.