In the title compounds, C(10)H(8)N(2)O(2), (I), and C(12)H(12)N(2)O(2), (II), the two carbonyl groups are oriented with torsion angles of -149.3 (3) and -88.55 (15)°, respectively. The single-bond distances linking the two carbonyl groups are 1.528 (4) and 1.5298 (17) Å, respectively. In (I), the molecules are linked by an elaborate system of N-H···O hydrogen bonds, which form adjacent R(2)(2)(8) and R(4)(2)(8) ring motifs to generate a ladder-like construct. Adjacent ladders are further linked by N-H···O hydrogen bonds to build a three-dimensional network. The hydrogen bonding in (II) is far simpler, consisting of helical chains of N-H···O-linked molecules that follow the 2(1) screw of the b axis. It is the presence of an elaborate hydrogen-bonding system in the crystal structure of (I) that leads to the different torsion angle for the orientation of the two adjacent carbonyl groups from that in (II).