A code algebra AC is a non-associative commutative algebra defined via a binary linear code C. We study certain idempotents in code algebras, which we call small idempotents, that are determined by a single nonzero codeword. For a general code C, we show that small idempotents are primitive and semisimple and we calculate their fusion law. If C is a projective code generated by a conjugacy class of codewords, we show that AC is generated by small idempotents and so is, in fact, an axial algebra. Furthermore, we classify when the fusion law is ℤ2-graded. In doing so, we exhibit an infinite family of ℤ2× ℤ2-graded axial algebras—these are the first known examples of axial algebras with a non-trivial grading other than a ℤ2-grading.