Let C be a small category and k a field. There are two interesting mathematical subjects: the category algebra kC and the classifying space |C| = BC. We study the ring homomorphism HH * (kC) → H * (|C|, k) and prove it is split surjective, using the factorization category of Quillen [18] and certain techniques from functor cohomology theory. This generalizes the well-known theorems for groups and posets. Based on this result, we construct a seven-dimensional category algebra whose Hochschild cohomology ring modulo nilpotents is not finitely generated, disproving a conjecture of Snashall and Solberg [20].