Abstract In this paper we classify the singular curves whose theta divisors in their generalized Jacobians are algebraic, meaning that they are cut out by polynomial analogs of theta functions. We also determine the degree of an algebraic theta divisor in terms of the singularities of the curve. Furthermore, we show a precise relation between such algebraic theta functions and the corresponding tau functions for the KP hierarchy.