We define the notions of trace, determinant and, more generally, Berezinian of matrices over a (Z2)-graded commutative associative algebra A. The applications include a new approach to the classical theory of matrices with coefficients in a Clifford algebra, in particular of quaternionic matrices. In a special case, we recover the classical Dieudonné determinant of quaternionic matrices, but in general our quaternionic determinant is different. We show that the graded determinant of purely even (Z2)-graded matrices of degree 0 is polynomial in its entries. In the case of the algebra A = H of quaternions, we calculate the formula for the Berezinian in terms of a product of quasiminors in the sense of Gelfand, Retakh, and Wilson. The graded trace is related to the graded Berezinian (and determinant) by a (Z2)-graded version of Liouville’s formula.