In the crystal structures of the two imidazole derivatives 5-chloro-1,2-dimethyl-4-nitro-1H-imidazole, C(5)H(6)ClN(3)O(2), (I), and 2-chloro-1-methyl-4-nitro-1H-imidazole, C(4)H(4)ClN(3)O(2), (II), C-Cl...O halogen bonds are the principal specific interactions responsible for the crystal packing. Two different halogen-bond modes are observed: in (I), there is one very short and directional C-Cl...O contact [Cl...O = 2.899 (1) A], while in (II), the C-Cl group approaches two different O atoms from two different molecules, and the contacts are longer [3.285 (2) and 3.498 (2) A] and less directional. In (I), relatively short C-H...O hydrogen bonds provide the secondary interactions for building the crystal structure; in (II), the C-H...O contacts are longer but there is a relatively short pi-pi contact between molecules related by a centre of symmetry. The molecule of (I) is almost planar, the plane of the nitro group making a dihedral angle of 6.97 (7) degrees with the mean plane of the imidazole ring. The molecule of (II) has crystallographically imposed mirror symmetry and the nitro group lies in the mirror plane.