The crystal structure of nicarbazin has been solved and refined using synchrotron X-ray powder diffraction data and optimized using density functional theory techniques. Nicarbazin is a co-crystal of 4,4′-dinitrocarbanilide (DNC) and 2-hydroxy-4,6-dimethylpyrimidine (HDP) molecules. Nicarbazin crystallizes in space group P-1 (#2) with a = 6.90659(8), b = 12.0794(4), c = 13.5040(7) Å, α = 115.5709(11), β = 102.3658(6), γ = 91.9270(4)°, V = 982.466(5) Å3, and Z = 2. The DNC and HDP molecules are linked by two strong N–H⋯O and N–H⋯N hydrogen bonds, and the HDP molecules are linked into centrosymmetric dimers by another N–H⋯O hydrogen bond. These strong hydrogen bonds link the molecules into layers parallel to the ab-plane and parallel stacking of both DNC and HDP molecules is prominent in the structure. The powder pattern has been submitted to ICDD for inclusion in the Powder Diffraction File™ (PDF®).