We give a combinatorial proof of the Dedekind-Mertens formula by computing the initial ideal of the content ideal of the product of two generic polynomials. As a side effect we obtain a complete classification of the rank 1 Cohen-Macaulay modules over the determinantal rings K[X]/I 2 (X). Let f, g be polynomials in one indeterminate over a commutative ring A. The Dedekind-Mertens formula relates the content ideals of f , g, and their product f g: one has c(f g)c(f) d = c(g)c(f) d+1 , d= deg g. It is the best universally valid variant of Gauß' classical formula c(f g) = c(f)c(g) for polynomials over a principal ideal domain. (The content ideal of f ∈ A[T ] is the ideal generated by the coefficients of f in A.) Content ideals and the Dedekind-Mertens formula have recently received much attention; see Glaz and Vasconcelos [8], Corso, Vasconcelos, and Villarreal [6] and Heinzer and Huneke [9], [10]. For detailed historical information about the Dedekind-Mertens formula, see [9]. The main objective of this paper is a combinatorial proof of the formula based on a Gröbner basis approach to the ideal c(f g) for polynomials with indeterminate coefficients; in fact we will determine the initial ideal of c(f g) with respect to a suitable term order. (For information on term orders and Gröbner bases we refer the reader to Eisenbud [7].) A side effect of our approach is very precise numerical information about the rank one Cohen-Macaulay modules over the determinantal ring S = K[X]/I 2 (X) where X is an m × n matrix of indeterminates and I 2 (X) the ideal generated by its 2-minors. This connection extends the ideas of [6] and was in fact suggested by them. The actual motive for our work was the need for some explicit computation modulo c(f g) in Boffi, Bruns, and Guerrieri [2], or, more precisely, modulo an ideal generalizing c(f g) slightly. Theorem 1. Let K be a field, R = K[