Let \(\textsf{Hom}^{0}(\Gamma ,G)\) be the connected component of the identity of the variety of representations of a finitely generated nilpotent group \(\Gamma \) into a connected reductive complex affine algebraic group G. We determine the mixed Hodge structure on the representation variety \(\textsf{Hom}^{0}(\Gamma ,G)\) and on the character variety \(\textsf{Hom}^{0}(\Gamma ,G)/\!\!/G\) . We obtain explicit formulae (both closed and recursive) for the mixed Hodge polynomial of these representation and character varieties.