We study Hilbert schemes of points on a smooth projective Calabi-Yau 4-fold X. We define DT 4 invariants by integrating the Euler class of a tautological vector bundle L [n] against the virtual class. We conjecture a formula for their generating series, which we prove in certain cases when L corresponds to a smooth divisor on X. A parallel equivariant conjecture for toric Calabi-Yau 4-folds is proposed. This conjecture is proved for smooth toric divisors and verified for more general toric divisors in many examples.Combining the equivariant conjecture with a vertex calculation, we find explicit positive rational weights, which can be assigned to solid partitions. The weighted generating function of solid partitions is given by exp(M (q) − 1), where M (q) denotes the MacMahon function.The virtual class (1.1) depends on the choice of orientation o(L). On each connected component of Hilb n (X), there are two choices of orientations, which affects the corresponding contribution to the class (1.1) by a sign. We review facts about the DT 4 virtual class in Section 2.1.In order to define the invariants, we require insertions. Let L be a line bundle on X and denote by L [n] the tautological (rank n) vector bundle over Hilb n (X) with fibre H 0 (L| Z ) over Z ∈ Hilb n (X). Then it makes sense to define the following: Definition 1.1. Let X be a smooth projective Calabi-Yau 4-fold and let L be a line bundle on X. Let L be the determinant line bundle of Hilb n (X) with quadratic form Q induced from Serre duality. Suppose L is given an orientation o(L). We define DT 4 (X, L, n ; o(L)) := [Hilb n (X)] vir o(L) e(L [n] ) ∈ Z, if n 1,where e(−) denotes the Euler class. We also set DT 4 (X, L, 0 ; o(L)) := 1.We make the following conjecture for the generating series of these invariants: 1 2 YALONG CAO AND MARTIJN KOOL Conjecture 1.2 (Conjecture 2.2). Let X be a smooth projective Calabi-Yau 4-fold and L be a line bundle on X. There exist choices of orientation such that ∞ n=0 DT 4 (X, L, n ; o(L)) q n = M (−q) X c1(L)·c3(X) , where