Let
M
M
be a nilmanifold, i.e.
M
=
G
/
D
M = G/D
where
G
G
is a simply connected, nilpotent Lie group and
D
D
is a discrete uniform, nilpotent subgroup. Then
M
≃
K
(
D
,
1
)
M \simeq K(D,1)
. Now
D
D
has the structure of an algebraic group and so has an associated algebraic group Lie algebra
L
(
D
)
L(D)
. The integral cohomology of
M
M
is shown to be isomorphic to the Lie algebra cohomology of
L
(
D
)
L(D)
except for some small primes depending on
D
D
. This gives an effective procedure for computing the cohomology of
M
M
and therefore the group cohomology of
D
D
. The proof uses a version of form cohomology defined for subrings of
Q
{\mathbf {Q}}
and a type of Hirsch Lemma. Examples, including the important unipotent case, are also discussed.