On a class number formula of Hurwitz

In a little-known paper Hurwitz gave an infinite series representation of the class number for positive definite binary quadratic forms. In this paper we give a similar formula in the indefinite case. We also give a simple proof of Hurwitz’s formula and indicate some extensions.