The structures of 4-nitrobenzene-1,2-diamine [C6H7N3O2, (I)], 2-amino-5-nitroanilinium chloride [C6H8N3O2(+)·Cl(-), (II)] and 2-amino-5-nitroanilinium bromide monohydrate [C6H8N3O2(+)·Br(-)·H2O, (III)] are reported and their hydrogen-bonded structures described. The amine group para to the nitro group in (I) adopts an approximately planar geometry, whereas the meta amine group is decidedly pyramidal. In the hydrogen halide salts (II) and (III), the amine group meta to the nitro group is protonated. Compound (I) displays a pleated-sheet hydrogen-bonded two-dimensional structure with R2(2)(14) and R4(4)(20) rings. The sheets are joined by additional hydrogen bonds, resulting in a three-dimensional extended structure. Hydrohalide salt (II) has two formula units in the asymmetric unit that are related by a pseudo-inversion center. The dominant hydrogen-bonding interactions involve the chloride ion and result in R4(2)(8) rings linked to form a ladder-chain structure. The chains are joined by N-H···Cl and N-H···O hydrogen bonds to form sheets parallel to (010). In hydrated hydrohalide salt (III), bromide ions are hydrogen bonded to amine and ammonium groups to form R4(2)(8) rings. The water behaves as a double donor/single acceptor and, along with the bromide anions, forms hydrogen bonds involving the nitro, amine, and ammonium groups. The result is sheets parallel to (001) composed of alternating R5(5)(15) and R6(4)(24) rings. Ammonium N-H···Br interactions join the sheets to form a three-dimensional extended structure. Energy-minimized structures obtained using DFT and MP2 calculations are consistent with the solid-state structures. Consistent with (II) and (III), calculations show that protonation of the amine group meta to the nitro group results in a structure that is about 1.5 kJ mol(-1) more stable than that obtained by protonation of the para-amine group. DFT calculations on single molecules and hydrogen-bonded pairs of molecules based on structural results obtained for (I) and for 3-nitrobenzene-1,2-diamine, (IV) [Betz & Gerber (2011). Acta Cryst. E67, o1359] were used to estimate the strength of the N-H···O(nitro) interactions for three observed motifs. The hydrogen-bonding interaction between the pairs of molecules examined was found to correspond to 20-30 kJ mol(-1).