There are many inequalities which in the class of continuous functions are equivalent to convexity (for example the Jensen inequality and the Hermite-Hadamard inequalities). We show that this is not a coincidence: every nontrivial linear inequality which is valid for all convex functions is valid only for convex functions.