Abstract
We prove that the word problem of a finitely generated group $G$ is in NP (solvable in polynomial time by a nondeterministic Turing machine) if and only if this group is a subgroup of a finitely presented group $H$ with polynomial isoperimetric function. The embedding can be chosen in such a way that $G$ has bounded distortion in $H$. This completes the work started in [6] and [25].