In this paper we study the isomorphism problem for the universal enveloping algebras of nilpotent Lie algebras. We prove that if the characteristic of the underlying field is not 2 or 3, then the isomorphism type of a nilpotent Lie algebra of dimension at most 6 is determined by the isomorphism type of its universal enveloping algebra. Examples show that the restriction on the characteristic is necessary.