The crystal structure of the title compound, C6H8N+·C8HN4O2−, is characterized by three independent ion pairs (A, B and C) in the asymmetric unit. Each ion pair consists of an anion and a cation, and the three ion pairs have similar geometric parameters. All the anions are arranged as dianion dimers via two N—H…O hydrogen bonds and the dimers form one-dimensional columns parallel to the b axis as a result of – interactions. The cations are also stacked, in two different ways: one type of stacking consists of alternating A and B cations, while the other type consists of C cations only. Each dianion dimer stack is surrounded by eight stacks of cations and is not connected directly to other dianion stacks.