Charge density analysis from both experimental and theoretical points of view on two molecular complexes: one is formed between nicotinamide and salicylic acid, and the other formed between nicotinamide and oxalic acid brings out the quantitative topological features to distinguish a cocrystal from a salt.