Résumé : In this work, the NOx formation mechanism in three-dimensional (3D) thermodiffusively unstable premixed hydrogen flames is investigated through direct numerical simulations (DNS) and a reaction path analysis based on the DNS dataset. In part I of this study (Wen et al., 2024), the characteristic patterns of the instabilities were studied using the same dataset. Here, first, the effects of the computational setup (2D vs. 3D) and curvature on the flux ratio of nitrogen atom are quantified. In addition, the composition space model (CSM) proposed in previous works is extended to account for the NOx chemical reaction mechanism to predict NOx formation in thermodiffusively unstable premixed hydrogen flames. The flamelet solutions are obtained from the premixed flamelet equations in composition space so that the wide range of curvatures associated with the strongly corrugated flame front can be considered. The performance of the CSM in predicting the NOx species and the important radicals involved in the NOx formation pathways is evaluated through an a priori analysis. To investigate the effects of curvature on the NOx formation pathways and the performance of the composition space model, the positively- and negatively-curved regions in the DNS are studied separately. The results show that different from the 2D simulation, the NNH reaction pathway becomes dominant in the 3D simulation due to the increased range of curvature, which promotes the accumulation of the highly diffusive H radical in the positively-curved regions. The NNH reaction pathway is dominant in the positively-curved regions, while the N2O reaction pathway is more important in the negatively-curved regions. The flamelet model based on the composition space solutions that consider the effects of curvature yields accurate predictions for the radicals that are sensitive to the effects of curvature. Novelty and significance statement The novelty of the present work includes the following aspects, (i) Analysis of NOx formation mechanism based on the large-scale 3D DNS dataset of a laminar fuel-lean premixed hydrogen flame on a sufficiently large domain; (ii) Quantification of the effects of computational setup (2D and 3D) and curvature on the NOx formation pathways; (iii) Extension of the previous composition space model (CSM) by incorporating the NOx chemical reaction mechanism to consider the effects of curvature on the NOx formation.